Environment Variables
Vite exposes variables that start with VITE_ to the browser.
Example
const api = import.meta.env.VITE_API_URL;
fetch(api + "/users");Exercise
Prefix.
API_URL=xQuiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.