set error handler
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/// / develop environment config
|
||||
const { isDev, isProduction, DevServerPort } = require('./_env')
|
||||
const errorHandler = require('./errorHandler')
|
||||
const wss = require('./WebSocket/wss')
|
||||
/// / init express app (wrapping all functions into init() to prevent running in development mode by nuxt dev mode)
|
||||
function init() {
|
||||
@@ -53,6 +54,7 @@ function init() {
|
||||
|
||||
app.use(isDev ? '/api' : '', router)
|
||||
|
||||
app.use(errorHandler.run)
|
||||
|
||||
return app
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user