Skip to content

Commit 4229948

Browse files
Copilothotlong
andcommitted
refactor: address code review feedback - improve docs and type safety
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent e792840 commit 4229948

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

api/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ let bootstrapPromise: Promise<void> | null = null;
4747
* Minimal plugin that exposes our Hono app as the `http.server` service.
4848
* ObjectOS plugins call `context.getService('http.server').getRawApp()`
4949
* to register their HTTP routes.
50+
*
51+
* Only `getRawApp()` and `app` are used by ObjectOS plugins; the
52+
* remaining stubs satisfy the IHttpServer shape expected by the kernel.
5053
*/
5154
function createHttpServicePlugin(honoApp: Hono): Plugin {
5255
return {
@@ -72,7 +75,7 @@ function createHttpServicePlugin(honoApp: Hono): Plugin {
7275
},
7376
async start() {},
7477
async destroy() {},
75-
} as unknown as Plugin;
78+
} as Plugin;
7679
}
7780

7881
async function bootstrapKernel(): Promise<void> {

apps/web/src/main.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ const queryClient = new QueryClient({
1414
},
1515
});
1616

17+
// BASE_URL is set by Vite based on the `base` config:
18+
// Vercel → "/" (stripped to ""), Local → "/console/" (stripped to "/console")
19+
const basename = import.meta.env.BASE_URL.replace(/\/+$/, '');
20+
1721
createRoot(document.getElementById('root')!).render(
1822
<StrictMode>
1923
<QueryClientProvider client={queryClient}>
20-
<BrowserRouter basename={import.meta.env.BASE_URL.replace(/\/+$/, '')}>
24+
<BrowserRouter basename={basename}>
2125
<App />
2226
</BrowserRouter>
2327
</QueryClientProvider>

0 commit comments

Comments
 (0)