Closed jamesmogambi closed 2 years ago
``Actually I was defining the route names wrongly, but its working.
Initially I was naming my routes like this: `import nc from "next-connect";
const handler = nc({ attachParams: true, });
handler.get("/user/:id/:", (req, res) => { console.log("dynamic param", req.params); res.json("User created");
});
export default handler;`
But you should name starting with - /api/[path]......: `handler.get("/api/user/:id/:", (req, res) => { console.log("dynamic param", req.params); res.json("User created");
});`
I tried implementing param matching as specified on docs of next-connect library, but it is not working....? Wanted to implement routes using param matching instead of creating many nested files...?