Closed bruceharrison1984 closed 9 months ago
What I found working was that you create a Hono instance with middleware before and pass it to createApp
function.
const base = new Hono<AppEnv>();
base.use(authMiddleware, envMiddleware);
const app = createApp({ app: base });
showRoutes(app);
export default app;
@mipopon Ah, ok that makes sense. Thanks!
npm create hono@latest
x-basic
server.ts
to include some middleware:Upon running, none of the middleware seems to be working. None of the response headers are altered per the middleware. This can also be verified because the
middleware!
text is never logged to the output.