-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
34 lines (23 loc) · 623 Bytes
/
Copy pathapp.js
File metadata and controls
34 lines (23 loc) · 623 Bytes
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
29
30
31
32
33
34
import MongoConnection from "./config/MongoConnection";
import bodyParser from "body-parser";
import Routes from "./routes";
import express from "express";
import morgan from "morgan";
import cors from "cors";
// Middlewares
import {
Cors,
} from "./middleware";
let dbConnection = new MongoConnection();
dbConnection.connect();
import {
UserModel,
} from "./model";
const app = express();
app.use(morgan("tiny"))
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
app.use(cors())
app.use(Cors)
app.use('/api', new Routes(express.Router()).registerRoutes())
export default app