hono
hono copied to clipboard
Honojs shows 404 Not Found in Postman on app.delete() route with sqlite db
I have used the url in Postman is http://localhost:3000/user/1 on my local bun server. In case id 1 already exists in database. My Code: app.delete("/user/:id", async (c)=> { const id = await c.req.param('id'); console.log(id); db.run("DELETE FROM users WHERE id=?",id); return c.json({message: 'Deleted'}); });
but other routes are working well.
Hi @techwebdocs
This error occurred by this bug of Bun. https://github.com/oven-sh/bun/issues/677
The only one thing that we can do is wait to fix the bug.
hey! you can move the delete verb to the url in the middletime
app.post("/user/:id/delete", async (c)=> {
const id = await c.req.param('id');
console.log(id);
db.run("DELETE FROM users WHERE id=?",id);
return c.json({message: 'Deleted'});
});
This seems to be closed.