-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
34 lines (26 loc) · 809 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
const express = require("express");
const path=require("path");
const app = express();
const port = 8000;
//express specific stuff
app.use('/static',express.static('static'))//for serving static files
app.use(express.urlencoded())
app.set('view engine','pug')//set temp engine as pug
app.set('views',path.join(__dirname,'views'))//set view directory
// ENDPOINTS
app.get('/', (req, res)=>{
const params = { }
res.status(200).render('home.pug', params);
})
app.get('/price', (req, res)=>{
const params = { }
res.status(200).render('price.pug', params);
})
app.get('/contact', (req, res)=>{
const params = { }
res.status(200).render('contact.pug', params);
})
// START THE SERVER
app.listen(port, ()=>{
console.log(`The application started successfully on port ${port}`);
});