working
This commit is contained in:
parent
c0999370c6
commit
4e1a339432
17 changed files with 393 additions and 91 deletions
22
frontend/e2e/helpers/backend-url.ts
Normal file
22
frontend/e2e/helpers/backend-url.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* Helper to determine which backend URL to use based on Playwright worker index.
|
||||
* Each worker gets its own backend instance and database.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get the backend URL for the current Playwright worker.
|
||||
* Uses NEXT_PUBLIC_API_URL which is set in setup.ts based on worker index.
|
||||
* Falls back to environment variable or default port 8001.
|
||||
*/
|
||||
export function getBackendUrl(): string {
|
||||
// NEXT_PUBLIC_API_URL is set in setup.ts based on worker index
|
||||
return process.env.NEXT_PUBLIC_API_URL || "http://localhost:8001";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the API URL for the current worker.
|
||||
* This is the same as getBackendUrl but with a clearer name.
|
||||
*/
|
||||
export function getApiUrl(): string {
|
||||
return getBackendUrl();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue