-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
32 lines (26 loc) · 842 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 fs = require('fs');
const app = express();
const port = 8000;
// EXPRESS RELATED STUFF
app.use(express.static('static')); // for seving static files
app.use("/static", express.static(path.join(__dirname, 'static')));
app.use(express.urlencoded());
// PUG SPECEFIC STUFF
app.set('view engine', 'pug');
app.set('views', path.join(__dirname, 'views'));
app.get('/', (req, res)=>{
const con = "This is the best content"
const params = {}
res.status(200).render('home.pug', params);
})
app.get('/contact', (req, res)=>{
const con = "This is the best content"
const params = {}
res.status(200).render('contact.pug', params);
})
// START THE SERVER
app.listen(port, ()=>{
console.log(`The application started succesfully at port ${port}`);
})