fix: update proxy path and MQTT broker URL in dev
Change the proxy path from `/journal` to `/.ttrpg` and ensure the MQTT broker URL points to localhost:3000 during development to match the CLI server configuration.
This commit is contained in:
parent
75e862c310
commit
f71af6a06d
|
|
@ -46,7 +46,7 @@ export default defineConfig({
|
|||
"/__CONTENT_INDEX.json": "http://localhost:3000",
|
||||
"/__COMPLETIONS.json": "http://localhost:3000",
|
||||
"/content": "http://localhost:3000",
|
||||
"/journal": "http://localhost:3000",
|
||||
"/.ttrpg": "http://localhost:3000",
|
||||
},
|
||||
},
|
||||
output: {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,12 @@ export const ConnectDialog: Component = () => {
|
|||
const name = playerName().trim() || stream.myName;
|
||||
if (!name) return;
|
||||
|
||||
const brokerUrl = `ws://${window.location.host}`;
|
||||
// In dev, the MQTT broker lives on the CLI server (port 3000), not the
|
||||
// rsbuild dev server. In production, the CLI serves everything itself.
|
||||
const brokerUrl =
|
||||
process.env.NODE_ENV === "development"
|
||||
? `ws://localhost:3000`
|
||||
: `ws://${window.location.host}`;
|
||||
|
||||
setConnecting(true);
|
||||
setError(null);
|
||||
|
|
|
|||
Loading…
Reference in New Issue