-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
26 lines (20 loc) · 676 Bytes
/
Copy pathapp.js
File metadata and controls
26 lines (20 loc) · 676 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
const express = require("express");
const app = express();
const path = require("path")
const port = 3000;
const bodyParser = require('body-parser');
//Express related code
app.use("/static", express.static('static'))//Serving static files
app.use(bodyParser.urlencoded({ extended: true }));
// Pug related code
app.set('view engine', 'pug')//Setting the template engine as pug
app.set('views', path.join(__dirname, "views")); //set the views directory
//Endpoints
app.get("/", (req, res) => {
const con = "niceness"
const params = { }
res.status(200).render('index.pug', params)
})
app.listen(port, () => {
console.log(`started on port ${port}`);
})