Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

Commit

Permalink
chore: setup env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
azabroflovski committed May 13, 2022
1 parent b1b8465 commit 3d08f1b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MXIK_API_URL=url_here
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ node_modules
dist
dist-ssr
*.local
.env

# Editor directories and files
.vscode/*
Expand Down
2 changes: 1 addition & 1 deletion src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '../typings'

export const http = createHttpClient({
baseURL: 'https://tasnif.soliq.uz/api' // see .env
baseURL: import.meta.env.MXIK_API_URL
})

/**
Expand Down
8 changes: 8 additions & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
/// <reference types="vite/client" />

interface ImportMetaEnv {
readonly MXIK_API_URL: string
}

interface ImportMeta {
readonly env: ImportMetaEnv
}

0 comments on commit 3d08f1b

Please sign in to comment.