-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
30 lines (23 loc) · 726 Bytes
/
Copy pathapp.js
File metadata and controls
30 lines (23 loc) · 726 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
const express = require("express");
const app = express();
const port = 3000;
const session = require("express-session");
const FileStore = require("session-file-store")(session);
app.use(session({
secret: 'fane-hwsn-2tgb-3b23',
resave: false,
saveUninitialized: true,
cookie: { secure: false }
}));
app.use(express.static("./app/public"));
app.set("view engine", "ejs");
app.set("views", "./app/views");
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
const rotas = require("./app/routes/router");
app.use("/", rotas);
const rotasAdm = require("./app/routes/routerAdm");
app.use("/", rotasAdm);
app.listen(port, () => {
console.log(`Servidor online\nhttp://localhost:${port}`);
});