25 lines
546 B
JavaScript
25 lines
546 B
JavaScript
import express from 'express'
|
|
import router from './routes/router.js'
|
|
|
|
const PORT = 1976
|
|
const app = express()
|
|
|
|
app.disable('etag')
|
|
app.use((req, res, next) => {
|
|
res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate')
|
|
res.header('Expires', '-1')
|
|
res.header('Pragma', 'no-cache')
|
|
next()
|
|
})
|
|
app.use(express.json())
|
|
app.use('/', router)
|
|
|
|
const startServer = async () => {
|
|
try {
|
|
app.listen(PORT, () => console.log('Server is running on port: ' + PORT))
|
|
} catch (e) {
|
|
console.error(e)
|
|
}
|
|
}
|
|
|
|
await startServer() |