forked from namz11/stevens-lost-found
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
41 lines (34 loc) · 991 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
30
31
32
33
34
35
36
37
38
39
40
41
const express = require("express");
const exphbs = require("express-handlebars");
const session = require("express-session");
const passport = require("passport");
const app = express();
const configRoutes = require("./routes");
app.use("/public", express.static(__dirname + "/public"));
app.use("/uploads", express.static("uploads"));
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(
session({
name: "AuthCookie",
secret: "secret",
resave: false,
saveUninitialized: false,
})
);
app.use(passport.initialize());
app.use(passport.session());
app.engine(
"handlebars",
exphbs.create({
helpers: require("./utils/handlebars").helpers,
defaultLayout: "home",
partialsDir: __dirname + "/views/templates/",
}).engine
);
app.set("view engine", "handlebars");
configRoutes(app);
app.listen(3000, () => {
console.log("We've now got a server!");
console.log("Your routes will be running on http://localhost:3000");
});