File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ The public-facing EzClaim web app lets ACSSZ members submit reimbursements witho
1414pnpm install
1515pnpm dev
1616```
17- The app assumes the API at ` http://localhost:8080 ` ; override via ` NEXT_PUBLIC_API_BASE_URL ` in ` .env.local ` when needed.
17+ Development defaults to the API at ` http://localhost:8080 ` ; production builds fall back to
18+ ` https://ezclaim.liuzisen.com ` . Override via ` NEXT_PUBLIC_API_BASE_URL ` in ` .env.local ` (or
19+ ` .env.production ` ) when needed.
1820
1921## License
2022Licensed under the Do What The Fuck You Want To Public License (WTFPL). See [ ` LICENCE ` ] ( LICENCE ) .
Original file line number Diff line number Diff line change @@ -10,7 +10,12 @@ export class HttpError extends Error {
1010 }
1111}
1212
13- const API_BASE = process . env . NEXT_PUBLIC_API_BASE_URL || 'http://localhost:8080' ;
13+ const defaultApiBase =
14+ process . env . NODE_ENV === 'production'
15+ ? 'https://ezclaim.liuzisen.com'
16+ : 'http://localhost:8080' ;
17+
18+ const API_BASE = process . env . NEXT_PUBLIC_API_BASE_URL || defaultApiBase ;
1419
1520async function http < T > ( path : string , init ?: RequestInit ) : Promise < T > {
1621 const hasBody = typeof init ?. body !== 'undefined' && init ?. body !== null ;
You can’t perform that action at this time.
0 commit comments