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
@julian-rare this router is not designed to be used with POST requests. Here is an example how to handle POST request with Express.js:
importexpressfrom'express';importRouterfrom'universal-router';constapp=express();// Authenticationapp.post('/token',async(req,res,next)=>{// <---try{// TODO: Validate the request and issue an OAuth token}catch(err){next(err);}});// Server-side renderingapp.get('*',async(req,res,next)=>{try{constresult=awaitRouter.resolve(routes,{path: req.path});// TODO: Return HTML response}catch(err){next(err);}});app.listen(process.env.PORT||3000);
an example would be great
The text was updated successfully, but these errors were encountered: