Access to fetch has been blocked by CORS policy – Vite/React/Express
I’m using Vite with React/Express and started the app with npm run dev – running on http://localhost:5173 and using http://localhost:5000 for the backend in the meantime. When trying to test a post request using fetch(), I’m constantly getting the following error:
Display images with vite using markdown from express server
I am using express to store images, using markdown.
I use multer on backend to store Images on backend on a folder called ‘uploads’.
In the controller, I build the URL referred to the image, and push it into a model array.