Home > Back-end >  The front-end cannot accept the page returned by the back-end route
The front-end cannot accept the page returned by the back-end route

Time:12-11

When the background route jumps to the front end to return to the page, it encounters the situation of downloading the page file。

enter image description here

enter image description here When clicking , the browser will download the post.html automatically

CodePudding user response:

Try using res.send or simply res.sendFile instead.

https://expressjs.com/en/api.html#res.send

  • Related