请求接口 : http://localhost:8000/api/v1/userss 接口不存在则 返回自定义404错误处理
定义404中间件
const HttpException = require('../exception/http.exception')const noMatchMiddleware = (req,res,next)=>{res.status(404).json({code:0,message:'Router Url not found'})}module.exports = noMatchMiddleware
使用404中间件
app.use(noMatchMiddleware)
