-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
49 lines (33 loc) · 939 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
44
45
46
47
48
require('dotenv').config()
const express = require('express')
const cookieParser = require("cookie-parser")
const fileUpload = require('express-fileupload');
const app = express()
app.set('view engine', 'ejs')
// global middleware
app.use(fileUpload());
app.use(express.static('public'))
app.use(express.json())
app.use(express.urlencoded({ extended: true }))
app.use(cookieParser())
// routers
const AuthenticationRoute = require('./routes/authRoutes.js')
const IPFSRoute = require('./routes/ipfsRoutes.js')
const PORT = process.env.PORT || 9080
app.use('/auth', AuthenticationRoute)
app.use('/ipfs', IPFSRoute)
app.listen(PORT, () => {
console.log("server listening on port " + PORT)
})
app.get('/',(req,res)=>{
res.render("index")
})
app.get('/contact',(req,res)=>{
res.render('contact')
})
app.get('/about-us',(req,res)=>{
res.render('about-us')
})
app.use('', (req, res) => {
res.render('404')
})