File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,10 @@ import { startMockServer } from './mocks/browser';
1212
1313// Start MSW before rendering the app
1414async function bootstrap ( ) {
15- // Initialize Mock Service Worker
16- await startMockServer ( ) ;
15+ // Initialize Mock Service Worker if enabled
16+ if ( import . meta. env . VITE_USE_MOCK_SERVER !== 'false' ) {
17+ await startMockServer ( ) ;
18+ }
1719
1820 // Render the React app
1921 ReactDOM . createRoot ( document . getElementById ( 'root' ) ! ) . render (
Original file line number Diff line number Diff line change 1+ /// <reference types="vite/client" />
Original file line number Diff line number Diff line change 11
22import { serveStatic } from '@hono/node-server/serve-static' ;
33import path from 'path' ;
4+ import { fileURLToPath } from 'url' ;
5+ import { dirname } from 'path' ;
6+
7+ const __filename = fileURLToPath ( import . meta. url ) ;
8+ const __dirname = dirname ( __filename ) ;
49
510export class ConsolePlugin {
611 name = 'com.objectstack.server.console' ;
@@ -24,9 +29,9 @@ export class ConsolePlugin {
2429
2530 ctx . logger . info ( 'Registering Console UI at /console' ) ;
2631
27- // Path relative to where server.ts is run (examples/crm)
28- // apps is ../../apps
29- const consoleDist = path . resolve ( process . cwd ( ) , '../../apps/console/dist' ) ;
32+ // Path relative to this file (examples/crm/console-plugin.ts )
33+ // ../../apps/console/dist
34+ const consoleDist = path . resolve ( __dirname , '../../apps/console/dist' ) ;
3035
3136 // Serve static resources (JS, CSS, etc)
3237 // Hono serveStatic will look for the file in root
You can’t perform that action at this time.
0 commit comments