-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrouter.js
More file actions
33 lines (24 loc) · 803 Bytes
/
router.js
File metadata and controls
33 lines (24 loc) · 803 Bytes
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
const express = require('express');
const app = express();
app.set('view engine','ejs')
const env = require("dotenv");
env.config();
app.use(express.static('public'));
app.use('/node_modules/@fortawesome/fontawesome-free', express.static(__dirname + '/node_modules/@fortawesome/fontawesome-free/'));
app.use('/node_modules/jquery/dist', express.static(__dirname + '/node_modules/jquery/dist/'));
app.get('/about',(req,res)=>{
res.render('about',{});
});
app.get('/ask',(req,res)=>{
res.render('ask',{});
});
app.get('/account',(req,res)=>{
res.render('account',{});
});
app.get('*',(req,res)=>{
res.render('main',{});
});
const PORT = process.env.PORT || 5500;
app.listen(PORT, ()=>{
console.log(`The server was started in port: ${PORT}`)
});