Replies: 3 comments 3 replies
-
FYI @yusukebe |
Beta Was this translation helpful? Give feedback.
0 replies
-
I tried with viteDevServer?.watcher.on('change', async (file) => {
const { default: importedRoute } = await viteDevServer.ssrLoadModule(file, { fixStacktrace: true })
app.routes.find((r) => <route> === r.path && <method>.toUpperCase() === r.method).handler = importedRoute
}) but the route handler doesn't change. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can't add a route after import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('foo'))
await app.request('/')
app.get('/extra', (c) => c.text('foo')) // Error! (expected) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context
With universal-autorouter, I need to replace a route handler (registered first time on Hono server start) when the related file changes (HMR ~ Hot Module Replacement).
After the re-register is called, I get:
Maybe should I remove the route and then re-register?
Beta Was this translation helpful? Give feedback.
All reactions