configure local dev api endpoint
This commit is contained in:
parent
69058b8ceb
commit
4446b228d7
5 changed files with 506 additions and 4 deletions
|
|
@ -25,5 +25,5 @@ This workspace packages a thin Electron shell around the hosted Islandflow app.
|
|||
## Development Notes
|
||||
|
||||
- `ISLANDFLOW_DESKTOP_START_URL` controls which trusted app URL Electron loads. Prefer `/options` for deep links; `/tape` remains supported and redirects in the web app for compatibility.
|
||||
- `NEXT_PUBLIC_API_URL` remains a web-app setting and should typically be `https://flow.deltaisland.io` when developing the local UI inside Electron.
|
||||
- `NEXT_PUBLIC_API_URL` remains a web-app setting and should typically be `https://api.flow.deltaisland.io` when developing the local UI inside Electron.
|
||||
- `assets/` currently contains placeholders only; a real `.icns` icon is deferred.
|
||||
|
|
|
|||
|
|
@ -1,9 +1,16 @@
|
|||
import { rm } from "node:fs/promises";
|
||||
|
||||
const DEFAULT_REMOTE_API_URL = "https://api.flow.deltaisland.io";
|
||||
|
||||
const run = async () => {
|
||||
const port = 3000;
|
||||
const distDir = ".next-dev";
|
||||
console.log(`[web] starting Next.js dev server on port ${port}`);
|
||||
console.log(
|
||||
`[web] API origin: ${Bun.env.NEXT_PUBLIC_API_URL ?? DEFAULT_REMOTE_API_URL}${
|
||||
Bun.env.NEXT_PUBLIC_API_URL ? " (from NEXT_PUBLIC_API_URL)" : " (default)"
|
||||
}`
|
||||
);
|
||||
|
||||
const path = Bun.env.PATH ?? "";
|
||||
const cwd = `${import.meta.dir}/..`;
|
||||
|
|
@ -21,6 +28,7 @@ const run = async () => {
|
|||
env: {
|
||||
...Bun.env,
|
||||
PATH: `${cwd}/node_modules/.bin:${path}`,
|
||||
NEXT_PUBLIC_API_URL: Bun.env.NEXT_PUBLIC_API_URL ?? DEFAULT_REMOTE_API_URL,
|
||||
PORT: String(port)
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue