You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to be able to pass the HonoOptions to the base hono instance.
I am trying to implement subdomain routes which in Hono are implemented using getPaths something like this.
constapp=newHono({getPath: (req)=>'/'+req.headers.get('host')+req.url.replace(/^https?:\/\/[^/]+(\/[^?]*)/,'$1'),})app.get('/www1.example.com/hello',(c)=>c.text('hello www1'))// A following request will match the route:// new Request('http://www1.example.com/hello', {// headers: { host: 'www1.example.com' },// })
I tried to make a patch that would pass the options from the ponder.config.ts (as below) but it since the hono service seems to be started from the virtualModule it wasn't so easy
consthono: HonoOptions<any>={getPath(request,options){// do stuff with subdomains},}exportdefaultcreateConfig({
database,
hono,
networks,contracts: {
...
},})
Is there a better way to implement this right now?
The text was updated successfully, but these errors were encountered:
It would be nice to be able to pass the
HonoOptions
to the base hono instance.I am trying to implement subdomain routes which in Hono are implemented using
getPaths
something like this.I tried to make a patch that would pass the options from the
ponder.config.ts
(as below) but it since the hono service seems to be started from thevirtualModule
it wasn't so easyIs there a better way to implement this right now?
The text was updated successfully, but these errors were encountered: