This commit is contained in:
2021-10-15 02:00:40 +03:00
parent 74316481f1
commit ade92e0493
15 changed files with 884 additions and 0 deletions

25
index.js Normal file
View File

@@ -0,0 +1,25 @@
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()