-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
42 lines (29 loc) · 794 Bytes
/
index.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
35
36
37
38
39
40
41
42
const express = require('express');
const path = require('path');
const PORT= 3000;
const Bundler = require('parcel-bundler')
const bundler = new Bundler(path.resolve(__dirname, 'views/layout.pug'))
const router = express.Router();
//Init App
const app =express();
// Load view Pug Engine
app.set('view engine', 'pug');
app.use(express.static(path.join(__dirname, 'public')))
// Home Route
app.get('', function(req, res){
res.render('home');
title: 'Home'
});
// About us Route
app.get('/about-us', function(req, res){
res.render('about-us');
title: 'About Us'
});
// Contact us Route
app.get('/contact-us', function(req, res){
res.render('contact-us');
title: 'Contact Us'
});
app.listen(PORT, function(){
console.log("Server Started on http://localhost:3000");
})