-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
28 lines (25 loc) · 895 Bytes
/
Copy pathapp.js
File metadata and controls
28 lines (25 loc) · 895 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
const express = require("express");
const bodyParser = require("body-parser");
const app = express();
const session = require("express-session");
const static = express.static(__dirname + "/public");
const configRoutes = require("./routes");
const express_handlebars = require("express-handlebars");
const router = express.Router();
const userData = require("./data/users");
const saltRounds = 16;
app.use('/public', static);
//set static to pubic folder
app.use(bodyParser.json());
// app.use(express.json());
app.use(bodyParser.urlencoded({ extended: false }));
configRoutes(app);
app.engine("handlebars", express_handlebars({
defaultLayout: "./main" ,
partialsDir:"./views/templates/partials",
}));
app.set("view engine", "handlebars");
app.listen(3000, () => {
console.log("We've now got a server!");
console.log("Your routes will now be running on http://localhost:3000");
});