Skip to content

Commit 3d08f1b

Browse files
committed
chore: setup env variables
1 parent b1b8465 commit 3d08f1b

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MXIK_API_URL=url_here

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ node_modules
1111
dist
1212
dist-ssr
1313
*.local
14+
.env
1415

1516
# Editor directories and files
1617
.vscode/*

src/api/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from '../typings'
88

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

1313
/**

src/vite-env.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
11
/// <reference types="vite/client" />
2+
3+
interface ImportMetaEnv {
4+
readonly MXIK_API_URL: string
5+
}
6+
7+
interface ImportMeta {
8+
readonly env: ImportMetaEnv
9+
}

0 commit comments

Comments
 (0)