Jsonstore.io in HTML
I have used jsonstore.io before, and am now trying to integrate it into a web app. I can't use require, because I am running it inside of a script tag in HTML. How would I do this?
Talking to jsonstore involves sending them an HTTP request. In fact, connecting to any website basically is you sending them an HTTP request and them sending you a response. So you can imagine why it is a feature that most languages support.
How you should be doing it today is using the Fetch API.
Basically, it lets you do this:
const result = await fetch(urlOfYourJsonstoreEndpoint); const data = await result.json(); // All your data is now in the 'data' variable
Which is about as easy as it gets, really.
Here are some useful links
If you encounter any problems in using it, I'll be more than happy to help!
@ryanhallihan The only problem you'll run into with jsonstore is CORS when running requests client side. You can initiate GET requests just fine, but you won't be able to POST, PUT, or PATCH any data back to the server without a server side implementation such as NodeJS.