Answers for "[Solved] URL scheme must be "http" or "https" for CORS request"

0

[Solved] URL scheme must be "http" or "https" for CORS request

//As per Quention's advice, I needed to add http:// in front of localhost:3001. The code became:

const url = new URL("http://localhost:3001")

//Afterwards, I needed to enable cors on my server in order to fix another error.

//Because I was using express, I just ran npm install cors and then added the following 2 lines to my server:

//use it in top your Express app

const cors = require("cors")
Posted by: Guest on October-22-2021

Code answers related to "[Solved] URL scheme must be "http" or "https" for CORS request"

Code answers related to "Javascript"

Browse Popular Code Answers by Language