igo
igo
Explore posts from servers
HHono
Created by igo on 1/29/2025 in #help
Help with REGEX doesnt work on route path definition
I have this route definition:
app.on(["POST", "GET"], "/api/auth/**", (c) => {
return auth.handler(c.req.raw);
});
app.on(["POST", "GET"], "/api/auth/**", (c) => {
return auth.handler(c.req.raw);
});
Its basically a listener, every path under /auth should be handled by the auth.handler. But I wanna exclude /auth/sign-up from this listener, I tried:
app.on(["POST", "GET"], "/api/auth/(?!sign-up).*", (c) => {
return auth.handler(c.req.raw);
});
app.on(["POST", "GET"], "/api/auth/(?!sign-up).*", (c) => {
return auth.handler(c.req.raw);
});
But this is not working. I also tried to add a route definition above this one, but this will make all the other routes stop working
app.post("/api/auth/sign-up", (c) => {
return c.json({
message: "Sign up successful",
});
});

// stop working
app.on(["POST", "GET"], "/api/auth/**", (c) => {
return auth.handler(c.req.raw);
});
app.post("/api/auth/sign-up", (c) => {
return c.json({
message: "Sign up successful",
});
});

// stop working
app.on(["POST", "GET"], "/api/auth/**", (c) => {
return auth.handler(c.req.raw);
});
23 replies
DTDrizzle Team
Created by igo on 3/1/2024 in #help
Can't insert uuid value in uuid foreign key
No description
4 replies