A
A
Alexey Kostyukhin2019-11-25 15:13:41
JavaScript
Alexey Kostyukhin, 2019-11-25 15:13:41

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

3 answer(s)
T
Timokins, 2019-11-25
@timokins

If you want to indulge and for free,
then myjson.com

A
Alexander, 2019-11-25
@NeiroNx

Apparently it's time to take a free hosting, because on github it's not at all the same.

S
Sergey Mukhin, 2019-11-25
@mukhindev

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 question

Ask a Question

731 491 924 answers to any question