bunrest
bunrest copied to clipboard
Middlewares Activating for All Methods of a Route
I have a path that can be accessed via GET
or POST
, for differing reasons. I have an auth middleware on the GET
handler, however, the middleware is also being applied to the POST
handler. See the code below:
authRouter.post("", async (req, res) => {
// stuff
res.status(200).json({ data });
});
authRouter.get("", authMiddleware, async (req, res) => {
// stuff
res.status(200).json({ data });
});
app.use("/analytics", authRouter);
Other Relevant Info:
Bun version: v1.0.7
bunrest version: v1.3.6
platform: ubuntu 20.04 (docker image)
node installed: yes
node version: v18.18.2