examples
examples copied to clipboard
Route issue in route example
Hi, Good job on Hono!
Followed this hono-example-blog example.
The route will become /post/post, not /post.
Index.ts should have this instead, think it would fix it.
app.route('/', middleware)
app.route('/', api)
Am I wrong? Please explain to me in that case how you're suppose to you app.route correct.
Hi @socketopp !
In that example, the route will become /api/posts. The path /posts will be appended to the path /api specified in route, and they will be merged:
api.get('/posts', (c) => c.text('Hi'))
//...
app.route('/api', api) // GET /api/posts => Hi