当直接在邮递员中传递 id 以进行测试请求时,我试图访问英雄的特定详细信息。但是,它会输出所有内容,而不仅仅是输出我要求的物品/英雄。
我究竟做错了什么?
// overwatch hero detail
app.get("/hero/:id", (req, res) => {
let detail = [
{
id: 1,
real_name: "Hana Song",
age: "19",
nationality: "Korean",
occupation: "Professional Gamer, Mech Pilot, Actress"
},
{
id: 2,
real_name: "Winston",
age: "20",
nationality: "",
occupation: "Scientist"
}
];
res.json(detail)
});