You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constHapi=require('@hapi/hapi');constnext=require('next')constdev=process.env.NODE_ENV!=='production'constapp=next({ dev })consthandle=app.getRequestHandler()app.prepare().then(()=>{constserver=Hapi.server({port: 3000,host: 'localhost'});server.route({method: ["POST","GET"],path: '/api/test',handler: async(request,h)=>{const{req,res}=h.request.raw;awaithandle(req,res);returnh.close;}});server.start();console.log('> Ready on http://localhost:3000');}).catch((ex)=>{console.error(ex.stack)process.exit(1)})
As above, GET can be successful, but the post request has been unresponsive. How to solve the problem? I tried experss and the post request was successful.
The text was updated successfully, but these errors were encountered:
Runtime
node
Runtime version
21.3.2
Module version
21.3.2
Used with
No response
Any other relevant information
No response
How can we help?
As above, GET can be successful, but the post request has been unresponsive. How to solve the problem? I tried experss and the post request was successful.
The text was updated successfully, but these errors were encountered: