Closed bruceharrison1984 closed 7 months ago
Thanks @bruceharrison1984 !
It's very interesting! The API in which it can export Middleware[]
as default seems to be good. I'll consider implementing this and replay it later.
@yusukebe I threw this together this morning: https://github.com/honojs/honox/pull/67
The work done for _renderer.tsx
did most of the hard work, this was relatively simple based on that!
What is the feature you are proposing?
Would it be possible to create a
_middleware.ts
file that would automatically add the middleware to routes at and below it? Cumulative_middleware
declarations would be merged, with higher ones taking precedence in the ordering.This would make it unnecessary to have to redeclare the middleware pipeline for each route, or manually create a Hono router just to gain access to the
use
method.Directory structure would look like: