0👍
Number 1: http://localhost:5000/api/posts/6061890d59ec3b6abcb011fb
is correct, but you’re going to need to create a new route to handle that request.
These are often called ‘show’ routes.
router.get("/:id", async (req, res) => {
// code to handle the logic of that request
// access the url parameter via: req.params.id
});
0👍
router.get("/:id", async (req, res) => {
const posts = await loadPostCollection();
res.send(await posts.findOne({
_id: req.params.id,
}));
});
- [Vuejs]-Use laravel + vue sanctum to apply authorization
- [Vuejs]-How can I update an existing v-select by setting the v-model?
Source:stackexchange.com