-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
37 lines (26 loc) · 715 Bytes
/
Copy pathserver.js
File metadata and controls
37 lines (26 loc) · 715 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
34
35
const express = require("express")
const app = express()
const PORT = process.env.PORT || 3000
const ejs = require('ejs')
const expressLayout = require('express-ejs-layouts')
const path = require('path')
app.use(express.static('public'))
//Set the template engine
app.use(expressLayout)
app.set('views', path.join(__dirname,'/resources/views'))
app.set('view engine', 'ejs')
app.get('/',function(req,res){
res.render("home")
})
app.get('/cart',(req,res)=> {
res.render('customers/cart')
})
app.get('/login',(req,res)=> {
res.render('auth/login')
})
app.get('/register',(req,res)=> {
res.render('auth/register')
})
app.listen(3000, () => {
console.log(`Listening on port ${PORT}`)
})