-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
28 lines (22 loc) · 808 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const express = require("express");
const cors = require("cors");
const config = require('./startup/config');
const bodyParser = require('body-parser');
const err = require('./middleware/errors');
const app = express();
const landmarkRoutes = require('./routes/landmark-routes');
const loginRoutes = require('./routes/login-routes');
const userRoutes = require('./routes/user-routes');
const logger = require('./startup/logging');
require('./startup/db')();
require('./startup/validations')();
// BodyParsing
app.use(express.urlencoded({extended: true}));
app.use(cors());
app.use(bodyParser.json());
// Routes
app.use(landmarkRoutes.routes);
app.use(loginRoutes.routes);
app.use(userRoutes.routes);
app.use(err);
app.listen(config.port, () => logger.log.info('App is listening on url ' + config.url));