-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
31 lines (22 loc) · 863 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
29
// Imports
const express = require("express");
const bodyParser = require("body-parser");
const helmet = require("helmet");
const app = express();
// Configure Header HTTP
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
res.header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, DELETE');
res.header('Allow', 'GET, POST, OPTIONS, PUT, DELETE');
res.header('Access-Control-Allow-Credentials', 'true');
next();
});
app.use(helmet());
app.use(express.json({limit: '50mb'}));
app.use(express.urlencoded({limit: '50mb'}));
// app.use(bodyParser.urlencoded({ extended: false }));
// app.use(bodyParser.json());
// Router Basic
require("./src/routers/index")(app);
module.exports = app;