Skip to content

fix: configure vite proxy #18

Open
jchanke wants to merge 3 commits intofullstack-hy2020:mainfrom
jchanke:patch-1
Open

fix: configure vite proxy #18
jchanke wants to merge 3 commits intofullstack-hy2020:mainfrom
jchanke:patch-1

Conversation

@jchanke
Copy link

@jchanke jchanke commented Jun 25, 2025

configures a vite proxy (per part 3 of the course) for api requests at the same port as the client.

the current app doesn't work out of the box, because the requests are made to a different port.

this fixes the issue. (i guess it also depends on whether you want the students to identify and fix this themselves, too!)

jchanke added 3 commits June 25, 2025 13:25
add a proxy to re-route the client's api requests to port 3001.

the default configuration leads to a CORS error since the client (at port 5173) is requesting data from the server (at port 3001).

one solution (from part 3 of the course) is to configure the `apiBaseUrl` to be `/api` (on the same port, 5173) and have the proxy re-route it.
changes `apiBaseUrl` to the same port (5173).

to be used together with a proxy in `vite.config.ts`.
to be used together with a proxy in `vite.config.ts`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant