Skip to content

Commit

Permalink
Add VITE prefix to env variable (#70)
Browse files Browse the repository at this point in the history
* add env variable for backend url

* actually change the backend url

---------

Co-authored-by: Hansel Lee <mr.hansel.lee@gmail.com>
  • Loading branch information
hlee131 and hlee131 authored May 22, 2024
1 parent dcfb5b1 commit 6df74f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function App({ queryClient }: { queryClient: QueryClient }) {
trpc.createClient({
links: [
httpBatchLink({
url: import.meta.env?.BACKEND_URL ?? 'http://localhost:3001',
url: import.meta.env?.VITE_BACKEND_URL ?? 'http://localhost:3001',
// You can pass any HTTP headers you wish here
async headers() {
const token = await getToken();
Expand Down
2 changes: 1 addition & 1 deletion client/src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface ImportMetaEnv {
readonly VITE_PROJECT_ID: string;
readonly VITE_AUTH_DOMAIN: string;
readonly VITE_API_KEY: string;
readonly BACKEND_URL: string;
readonly VITE_BACKEND_URL: string;
// more env variables...
}

Expand Down

0 comments on commit 6df74f8

Please sign in to comment.