mirror of
https://github.com/hknsh/project-knedita.git
synced 2024-11-29 01:41:16 +00:00
21 lines
374 B
JavaScript
21 lines
374 B
JavaScript
|
import 'dotenv/config'
|
||
|
|
||
|
import express from 'express'
|
||
|
import router from './routes.js'
|
||
|
import compression from 'compression'
|
||
|
|
||
|
const app = express()
|
||
|
|
||
|
app.use(express.json())
|
||
|
app.use(express.urlencoded({ extended: true }))
|
||
|
app.use(router)
|
||
|
app.use(compression({ level: 9 }))
|
||
|
|
||
|
app.use((_req, res) => {
|
||
|
res.status(404).json({
|
||
|
error: 'Not found'
|
||
|
})
|
||
|
})
|
||
|
|
||
|
export default app
|