autosnippet 2.19.5 → 2.19.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/http/HttpServer.js +3 -3
- package/package.json +1 -1
package/lib/http/HttpServer.js
CHANGED
|
@@ -268,13 +268,13 @@ export class HttpServer {
|
|
|
268
268
|
});
|
|
269
269
|
});
|
|
270
270
|
|
|
271
|
-
// 404
|
|
272
|
-
this.app.
|
|
271
|
+
// 404 处理(使用 app.all 确保 layer.route 存在,mountDashboard 依赖此属性定位并重排路由栈)
|
|
272
|
+
this.app.all('*', (req, res) => {
|
|
273
273
|
res.status(404).json({
|
|
274
274
|
success: false,
|
|
275
275
|
error: {
|
|
276
276
|
code: 'NOT_FOUND',
|
|
277
|
-
message: `Route not found: ${req.method} ${req.
|
|
277
|
+
message: `Route not found: ${req.method} ${req.originalUrl}`,
|
|
278
278
|
},
|
|
279
279
|
});
|
|
280
280
|
});
|