-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
33 lines (27 loc) · 662 Bytes
/
index.js
File metadata and controls
33 lines (27 loc) · 662 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
'use strict'
import dotenv from 'dotenv'
import express from 'express'
import cors from 'cors'
import session from 'express-session'
import { router, authentication, shops } from './routes'
dotenv.config()
const app = express()
app.use(express.json())
app.use(cors())
app.use(
session({
secret: process.env.SESSION_SECRET_KEY,
resave: false,
saveUninitialized: false,
cookie: {
maxAge: Number(process.env.SESSION_TIME_OUT_LIMIT)
}
})
)
const port = 8000
app.listen(port, () => {
console.log(`App running on port ${port}`)
})
app.use('/api/v1/route', router)
app.use('/authenticate', authentication)
app.use('/shops', shops)