Skip to content

Commit c433039

Browse files
committed
Update Vite server configuration to default to port 5173 and add API proxy settings
1 parent 210534a commit c433039

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

apps/studio/vite.config.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,21 @@ export default defineConfig({
4747
},
4848
plugins: [react()],
4949
server: {
50-
port: parseInt(process.env.VITE_PORT || '3000'),
50+
// Default to 5173 (Vite default) to avoid conflict with ObjectStack API server on 3000.
51+
// Use VITE_PORT env var to override (e.g. when embedded in CLI via --ui).
52+
port: parseInt(process.env.VITE_PORT || '5173'),
5153
hmr: hmrConfig,
54+
// Proxy API requests to the ObjectStack server when running standalone
55+
proxy: {
56+
'/api': {
57+
target: 'http://localhost:3000',
58+
changeOrigin: true,
59+
},
60+
'/.well-known': {
61+
target: 'http://localhost:3000',
62+
changeOrigin: true,
63+
},
64+
},
5265
},
5366
optimizeDeps: {
5467
include: [

0 commit comments

Comments
 (0)