-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
28 lines (23 loc) · 770 Bytes
/
app.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
require('dotenv').config();
const express = require('express');
let app = express();
app.use((req, res, next) => {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader(
'Access-Control-Allow-Headers',
'Origin, X-Requested-With, Content-Type, Accept, Authorization'
);
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PATCH, DELETE');
next();
});
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
const profile = require("./routes/profile");
const agent = require("./routes/agent");
const loan = require("./routes/loan");
const admin = require("./routes/admin");
app.use("/",profile);
app.use("/agent", agent);
app.use("/admin", admin);
app.use("/loan", loan ); // for all
module.exports = app