-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb.js
More file actions
25 lines (20 loc) · 678 Bytes
/
Copy pathweb.js
File metadata and controls
25 lines (20 loc) · 678 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
"use strict";
const express = require('express');
const helmet = require('helmet');
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const api = require('./routes/api.js');
const exphbs = require('express-handlebars');
var app = express();
app.use(helmet());
app.use(bodyParser.urlencoded({extended: false}))
app.use(bodyParser.json())
app.use(cookieParser())
app.use('', api);
app.set('views', './public/views');
app.set('view engine', '.hbs');
app.engine('.hbs', exphbs({defaultLayout:'main', extname: '.hbs'}));
app.use(express.static('public'));
app.listen(8000, "0.0.0.0", (req,res)=> (
console.log("Server Started Well")
));