set error handler

This commit is contained in:
Mr Swift
2024-08-11 18:26:18 +03:30
parent 648acf59aa
commit 9769e2cf63
3 changed files with 85 additions and 0 deletions
+2
View File
@@ -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
}