Skip to content
Snippets Groups Projects
Commit 7b0c4d89 authored by Fin Wallis's avatar Fin Wallis
Browse files

Created express server and connected to back-end MongoDB

parents
No related branches found
No related tags found
1 merge request!1Master
Showing
with 89 additions and 0 deletions
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
{
"presets": [
"env",
"stage-0"
]
}
\ No newline at end of file
import express from 'express';
import mongoose from 'mongoose';
// Creating express object and declaring hosting server port
const app = express();
const PORT = 3000;
// MongoDB connection
mongoose.Promise = global.Promise;
mongoose.connect('mongodb://localhost/TickcryptDB', {
useNewUrlParser: true,
useUnifiedTopology: true
})
.then((result) => console.log('Connected to DB'))
.catch((err) => console.log(err));
// Body parser setup
app.use(express.urlencoded({extended: true}));
app.use(express.json());
app.get('/', (req, res) =>
res.send(`Tickcrypt app is running on ${PORT}`)
);
app.listen(PORT, () =>
console.log(`Your app server is running on port ${PORT}`)
);
\ No newline at end of file
../atob/bin/atob.js
\ No newline at end of file
../babel-cli/bin/babel.js
\ No newline at end of file
../babel-cli/bin/babel-doctor.js
\ No newline at end of file
../babel-cli/bin/babel-external-helpers.js
\ No newline at end of file
../babel-cli/bin/babel-node.js
\ No newline at end of file
../babylon/bin/babylon.js
\ No newline at end of file
../is-ci/bin.js
\ No newline at end of file
../loose-envify/cli.js
\ No newline at end of file
../mime/cli.js
\ No newline at end of file
../mkdirp/bin/cmd.js
\ No newline at end of file
../cross-spawn/node_modules/which/bin/node-which
\ No newline at end of file
../nodemon/bin/nodemon.js
\ No newline at end of file
../touch/bin/nodetouch.js
\ No newline at end of file
../nopt/bin/nopt.js
\ No newline at end of file
../rc/cli.js
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment