fix: var name

This commit is contained in:
Stanley Cheung 2026-02-20 21:24:10 +08:00
parent 825c012558
commit 6f26f8c08f
4 changed files with 6 additions and 9 deletions

View File

@ -1,2 +1,2 @@
# Public
NEXT_PUBLIC_AUTH_API_BASE_URL=https://localhost:3000/api
NEXT_PUBLIC_API_URL=https://localhost:3000/api

View File

@ -1,7 +1,6 @@
steps:
- name: gcr.io/cloud-builders/docker
id: Build image
dir: apps/web
args:
- build
- -f
@ -16,14 +15,12 @@ steps:
- name: gcr.io/cloud-builders/docker
id: Push latest
dir: apps/web
args:
- push
- ${_AR_HOSTNAME}/${_AR_PROJECT_ID}/${_AR_REPOSITORY}/${_SERVICE_NAME}:latest
- name: gcr.io/cloud-builders/docker
id: Push commit tag
dir: apps/web
args:
- push
- ${_AR_HOSTNAME}/${_AR_PROJECT_ID}/${_AR_REPOSITORY}/${_SERVICE_NAME}:${SHORT_SHA}

View File

@ -2,19 +2,19 @@ import { afterEach, beforeEach, describe, expect, test } from "bun:test";
import { BackendAuthError, backendAuthApi } from "./api-client";
const originalFetch = globalThis.fetch;
const originalBaseUrl = process.env.NEXT_PUBLIC_AUTH_API_BASE_URL;
const originalBaseUrl = process.env.NEXT_PUBLIC_API_URL;
describe("backend auth api client", () => {
beforeEach(() => {
process.env.NEXT_PUBLIC_AUTH_API_BASE_URL = "http://localhost:3001/api";
process.env.NEXT_PUBLIC_API_URL = "http://localhost:3001/api";
});
afterEach(() => {
globalThis.fetch = originalFetch;
if (typeof originalBaseUrl === "string") {
process.env.NEXT_PUBLIC_AUTH_API_BASE_URL = originalBaseUrl;
process.env.NEXT_PUBLIC_API_URL = originalBaseUrl;
} else {
delete process.env.NEXT_PUBLIC_AUTH_API_BASE_URL;
delete process.env.NEXT_PUBLIC_API_URL;
}
});

View File

@ -1,5 +1,5 @@
export const getBackendApiBaseUrl = () => {
const configuredBase = process.env.NEXT_PUBLIC_AUTH_API_BASE_URL;
const configuredBase = process.env.NEXT_PUBLIC_API_URL;
return (configuredBase && configuredBase.length > 0 ? configuredBase : "/api").replace(
/\/$/,
"",