-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
33 lines (25 loc) · 900 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
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())
//PUG SPECIFIC STUFF
app.set('view engine','pug')//set the template engine as pug
app.set('views', path.join(__dirname,'views'))//set the views directory
//END POINTS
app.get('/',(req,res)=>{
const con ="This is the best content on internet so far so use it wisely";
const params={}
res.status(200).render('/github.io/home.pug', params)
})
app.get('/contact',(req,res)=>{
const con ="This is the best content on internet so far so use it wisely";
const params={}
res.status(200).render('/github.io/contact.pug', params)
})
//START THE SERVER
app.listen(port,()=>{
console.log(`The application started successfully on port ${port}`)
})