forked from Archivaldi/AutoArbi-Trader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
27 lines (24 loc) · 779 Bytes
/
server.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
var express = require('express');
var app = express();
const path = require('path');
const bodyParser = require("body-parser");
const session = require('cookie-session');
const { secret: { secret } } = require('./config/keys');
const PORT = process.env.PORT || 8080;
const connection = require("./config/db");
//package for uploading files on server
let upload = require('express-fileupload');
app.use(upload())
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(
session({
cookie: { maxAge: 1 * 1000 * 60 * 60 * 24 * 365 },
secret: secret,
})
);
app.use(express.static(path.join(__dirname, './client/out')));
app.use(require('./controllers/'));
app.listen(PORT, () => {
console.log(`Listening on ${PORT}`);
});