-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
43 lines (35 loc) · 933 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
35
36
37
38
39
40
41
42
43
const express = require("express")
// const connection = require("./src/models/connection")
const path = require("path");
const app = express();
// const port = 80;
const port = process.env.PORT || 3000
// app.use('static', express.static('static'))
app.set('views',path.join(__dirname, 'views'))
app.set('view engine', 'pug')
// app.use(bodyParser.urlencoded({extended: false}));
// app.use(bodyParser.json());
app.use(express.static(path.join(__dirname,'public')))
app.get("/",(req,res)=>{
res.render('home',{
title: 'Home'
});
});
app.get('/courses',(req,res)=>{
res.render('courses',{
title:'Courses'
});
});
app.get('/login',(req,res)=>{
res.render('login',{
title:'Login'
});
});
app.get('/signup',(req,res)=>{
res.render('Signup',{
title:'Signup'
});
});
app.listen(port,()=>{
console.log(`The application started successfully on port ${port}`);
});