测试人员需要探活接口,用于检测网站
serverMiddleWare/ping.js下
export default function (req, res, next) {
res.writeHead(200, {
"content-type": "text/plain; charset=utf-8"
});
res.end("pong");
}
nuxt.config.js下
serverMiddleware: [
{
path:'/ping',
handler:'~/serverMiddleware/ping.js'
}
],