Skip to content

Commit

Permalink
fix for ts client
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Oct 19, 2023
1 parent 595adc8 commit 5d6f7b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
VITE_API_BASE_URL=https://api.dev.kittycad.io
VITE_SITE_BASE_URL=https://dev.kittycad.io
BASE_URL=https://api.dev.kittycad.io/
6 changes: 6 additions & 0 deletions src/routes/+layout.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ export const load = async ({ cookies }) => {
}
}

// We need to tell the client to use the right base URL
if (import.meta.env.MODE !== 'production') {
// Set the env variable BASE_URL to import.meta.env.VITE_API_BASE_URL.
// This will be used by the client to make requests to the API.
process.env.BASE_URL = import.meta.env.VITE_API_BASE_URL + '/'
}
const client = new Client(token)
const response = await users.get_user_self({ client })

Expand Down

0 comments on commit 5d6f7b3

Please sign in to comment.