honox
honox copied to clipboard
basePath has no effect on app created by honox createApp
What version of HonoX are you using?
What steps can reproduce the bug?
Setting basePath in the following way doesn't work in server.ts
import { showRoutes } from "hono/dev";
import { createApp } from "honox/server";
const app = createApp().basePath("/api");
showRoutes(app);
export default app;
What is the expected behavior?
Following routes
GET /api GET /api/test
What do you see instead?
Following routes
GET / GET /test
Additional information
No response
Hi @monim67
Currently, you can't specify the base path with your method. You can specify the base path with setting the app option of createApp():
import { Hono } from 'hono'
import { showRoutes } from 'hono/dev'
import { createApp } from 'honox/server'
const baseApp = new Hono().basePath('/api')
const app = createApp({
app: baseApp
})
showRoutes(app)
export default app