1
0

Video 108: Express Middleware

This commit is contained in:
JayWll 2020-04-13 16:52:17 -06:00
parent d4dac9c676
commit 526fc9ebdd

View File

@ -6,6 +6,18 @@ const taskRouter = require('./routers/task')
const app = express()
const port = process.env.PORT || 4200
// app.use((req, res, next) => {
// if (req.method === 'GET') {
// res.send('GET requests are disabled')
// } else {
// next()
// }
// })
app.use((req, res, next) => {
res.status(503).send('Site is in maintenance mode').end()
})
app.use(express.json())
app.use(userRouter)
app.use(taskRouter)