-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
24 lines (18 loc) · 818 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
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const logger = require('morgan');
const dotenv = require('dotenv').config();
const helmet = require('helmet');
const db = require('./db') ;
const routes = require('./routes');
app.use(helmet());
app.use(logger('dev'));
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
// config & routes
app.use('/v1', routes );
app.use(function(req, res, next) {
return res.status(404).send({'response': 'Route Not Found.' })
})
module.exports = app;