forked from AmitBhardwaj26/Codechef_MMMUT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
27 lines (19 loc) · 759 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
const express = require("express");
const bodyParser = require("body-parser");
const router=require("./users");
const app = express();
const path = require('path');
const hbs= require("hbs");
app.set("view engine","hbs"); //ejs
const template_path=path.join(__dirname,"/templates/views");
const partials_path=path.join(__dirname,"/templates/partials");
app.set("view engine","hbs"); //hbs
app.set("views",template_path);
hbs.registerPartials(partials_path); //register the partials call
app.use('/css', express.static("css"));
app.use(bodyParser.urlencoded({ extended: true })); //body parser
app.use(router); // use the routers
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`server started on port ${PORT}`);
});