Skip to content

Commit

Permalink
improve frontend .env validation
Browse files Browse the repository at this point in the history
  • Loading branch information
tienday committed Oct 12, 2024
1 parent 426d864 commit 664e7c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/src/const/API.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const HOST =
process.env.REACT_APP_SERVER_HOST ?? window.location.hostname ?? "localhost"
const PORT = process.env.REACT_APP_SERVER_PORT ?? window.location.port ?? 8000
process.env.REACT_APP_SERVER_HOST || window.location.hostname || "localhost"
const PORT = process.env.REACT_APP_SERVER_PORT || window.location.port || 8000
const PROTO =
process.env.REACT_APP_SERVER_PROTO ??
window.location.protocol.replace(":", "") ??
process.env.REACT_APP_SERVER_PROTO ||
window.location.protocol.replace(":", "") ||
"http"

export const BASE_URL =
Expand Down

0 comments on commit 664e7c8

Please sign in to comment.