The / post/:id interface is accessed twice in a row, and the id value passed in the second time is performance-now.js.map.

use an article details interface written in the koa framework, router is: / post/:id. When the
address bar enters localhost:3000/post/5c3edc8815ec073b1c221563, the article details API is called twice in a row. The id obtained by
for the first time is 5c3edc8815ec073b1c221563, which is correct; the id obtained for the second time is performance-now.js.map, which is magical.

nodemon,koa-views,koa-static,koa-session,koa-bodyparser is used in this project.

later, I changed router to / post/:id/detail to avoid the above problems.

but I still don"t understand why the article details API is automatically called twice when / post/:id?

May.31,2022
Menu