Skip to content

Commit

Permalink
feat: env
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Nov 12, 2024
1 parent 4f8ea3e commit 7c8cc77
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FAUCET_BACKEND_URL=https://faucet.aelf.dev
1 change: 1 addition & 0 deletions .env.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FAUCET_BACKEND_URL=https://faucet-staging.aelf.dev
2 changes: 1 addition & 1 deletion .github/workflows/s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun run build
- run: bun run build${{ github.ref != 'refs/heads/main' && ' --mode staging' || '' }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion src/components/app/faucet-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function FaucetForm() {

async function onSubmit(values: z.infer<typeof formSchema>) {
const res = await fetch(
`https://faucet.aelf.dev/api/${
`${import.meta.env.FAUCET_BACKEND_URL}/api/${
{
[EChoices.ELF]: "claim",
[EChoices.TOKEN]: "claim-seed",
Expand Down
9 changes: 9 additions & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
/// <reference types="vite/client" />

interface ImportMetaEnv {
readonly FAUCET_BACKEND_URL: string;
// more env variables...
}

interface ImportMeta {
readonly env: ImportMetaEnv;
}

0 comments on commit 7c8cc77

Please sign in to comment.