Skip to content

Commit

Permalink
feat: serve frontend only for dev with production backend
Browse files Browse the repository at this point in the history
  • Loading branch information
EresDev committed Jan 10, 2025
1 parent fcfb2be commit 1095f79
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# common variables
CHAIN_ID="" # mainnet: 1, goerli: 5
FRONTEND_URL=""
BACKEND_URL="/" # if you want to work on frontend only, use "https://pay.ubq.fi"
UBIQUIBOT_PRIVATE_KEY=""
RPC_PROVIDER_URL=""
PAYMENT_TOKEN_ADDRESS="" # // DAI address, mainnet: 0x6b175474e89094c44da98b954eedeac495271d0f, goerli: 0x11fE4B6AE13d2a6055C8D9cF65c55bac32B5d844
Expand Down
2 changes: 1 addition & 1 deletion build/esbuild-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const esBuildContext: esbuild.BuildOptions = {
},
outdir: "static/out",
entryNames: "[dir]", // Ensure the CSS is named bundles.css
define: createEnvDefines(["SUPABASE_URL", "SUPABASE_ANON_KEY"], {
define: createEnvDefines(["SUPABASE_URL", "SUPABASE_ANON_KEY", "BACKEND_URL"], {
commitHash: execSync(`git rev-parse --short HEAD`).toString().trim(),
}),
plugins: [
Expand Down
5 changes: 3 additions & 2 deletions static/scripts/rewards/gift-cards/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import ct from "countries-and-timezones";

declare const BACKEND_URL: string;

export function getApiBaseUrl() {
// specify when backend functions and frontend are deployed to a different URL
return "";
return BACKEND_URL;
}

async function getCountryCodeByIp() {
Expand Down

0 comments on commit 1095f79

Please sign in to comment.