-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
29 lines (23 loc) · 759 Bytes
/
Copy pathindex.js
File metadata and controls
29 lines (23 loc) · 759 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
const express = require("express");
const session = require("express-session");
const MongoStore = require("connect-mongo")(session);
const mongooseConnection = require("./db/dbconnect").connection;
const path = require("path");
const bodyParser = require("body-parser");
const app = express();
app.use(
session({
secret: "sessionsecretsessionsecret",
resave: true,
saveUninitialized: true,
store: new MongoStore({
mongooseConnection: mongooseConnection
})
})
);
const staticPath = path.normalize(__dirname + "/public");
app.use(express.static(staticPath));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
const routes = require("./routes/api/routes")(app);
const server = app.listen(1428);