H
Hono2mo ago
cometkim

Multipath route parameters in Hono

How can I express a "multipath segments" in Hono? I'm trying to use Hono for the Cloudflare Pages Functions -> Workers transition and I have a route like this: functions/[[app]]/[hash].zip.ts // e.g. /my-app/nested/path/12345.zip // -> app: ["my-app", "nested", "path"] // -> hash: "12345"
Cloudflare Docs
Routing | Cloudflare Pages docs
Functions utilize file-based routing. Your /functions directory structure determines the designated routes that your Functions will run on. You can create a /functions directory with as many levels as needed for your project’s use case. Review the following directory:
1 Reply
cometkim
cometkimOP2mo ago
Ok, simply using :app{.+}/:hash.zip seems to be enough Actually it's not enough... there are more route under app - [[app]] - (index) - meta.json - [hash].zip Seems the Hono regexp router does not order its priority correctly.
Want results from more Discord servers?
Add your server