skip to Main Content

How to get data from response? Express js – Javascript

I am very new to node js. I am just testing some stuff about client-server communication. I have these codes: server: app.post('/zsa', (req, res) => { res.send("zsamo"); }); client: fetch("http://localhost:3000/zsa", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify(data),…

VIEW QUESTION

CORS ISSUE trying to send data to my server – Reactjs

"Access to XMLHttpRequest at 'http://localhost:3000/campgrounds/6411f03e718f68104cac045a' (redirected from 'http://localhost:5000/campgrounds') from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource." This is my code on…

VIEW QUESTION
Back To Top
Search