Skip to content

Commit

Permalink
add env variable for backend url (#69)
Browse files Browse the repository at this point in the history
Co-authored-by: Hansel Lee <mr.hansel.lee@gmail.com>
  • Loading branch information
hlee131 and hlee131 authored May 15, 2024
1 parent 1ffec21 commit dcfb5b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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: 'http://localhost:3001',
url: import.meta.env?.BACKEND_URL ?? 'http://localhost:3001',
// You can pass any HTTP headers you wish here
async headers() {
const token = await getToken();
Expand Down
1 change: 1 addition & 0 deletions client/src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface ImportMetaEnv {
readonly VITE_PROJECT_ID: string;
readonly VITE_AUTH_DOMAIN: string;
readonly VITE_API_KEY: string;
readonly BACKEND_URL: string;
// more env variables...
}

Expand Down

0 comments on commit dcfb5b1

Please sign in to comment.