We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f390599 commit 1c04e6cCopy full SHA for 1c04e6c
src/httpServer/index.js
@@ -24,6 +24,15 @@ app.use(serveStatic(publicPath, {
24
// Directory listing for static files
25
app.use(serveIndex(publicPath, { icons: true }))
26
27
+// Error handling middleware
28
+app.use((err, req, res, next) => {
29
+ logger.error(`Server error: ${err.message}`, { stack: err.stack })
30
+ res.status(500).json({
31
+ error: 'Internal Server Error',
32
+ message: 'Check server logs for more details'
33
+ })
34
+})
35
+
36
// Create API router
37
function createApiRouter () {
38
const router = express.Router()
0 commit comments