Skip to content

Any way to modify the request path in middleware? #2642

Answered by kornysietsma
kornysietsma asked this question in Q&A
Discussion options

You must be logged in to vote

sadly that only works if our external clients all respect 301 redirect and I'm not totally confident they do.
What we decided on was to move to hono v4 and just specify multiple paths. (and we ditched the hod-zono-openapi stuff so we can hide the /v1 from our schema)

Our resulting code:

  app.on('GET', ['/foo', '/v1/foo'],

Not as generic as a middleware for all routes - but a lot less work.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kornysietsma
Comment options

Answer selected by kornysietsma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants