Answer the question
In order to leave comments, you need to log in
How to create your own json file and access it by url?
Hello, I'm learning js. Reached network requests.
I know how to work with fetch and educational resources like swapi.co
Now my task is to create my own json file, upload this file there, access it by url through fetch and process the data.
I saw a couple of videos where they did it with the help of GH (gitHub). I tried to throw naked js in json format on GH, nothing happened.
The task is to use a non-local server.
Answer the question
In order to leave comments, you need to log in
Apparently it's time to take a free hosting, because on github it's not at all the same.
If json is just a file, then a static hosting is enough where this file can be put. But on the server giving this file, you need to configure CORS, otherwise if the client and server are at different addresses / ports, there will be an error.
What about in the browser console? Usually the answer is there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question