Skip to content

Bakon/local-api-caching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Caches api requests locally

This script was originally made to cache API requests to PokéAPI, to strain their servers just a tiny bit less.

There are 2 constants in the index.rb file, POKE_API_URL and LOCAL_API_URL.

Make sure to change the LOCAL_API_URL to the port you're using, in theory you could change the POKE_API_URL to whatever URL you want and it'll cache those requests in memory.

Usage

Start by installing the gems

bundle install

You can then run the script

ruby index.rb

Now that you're done, you can make API calls to your LOCAL_API_URL constant.

This will now serve the JSON, instead of always fetching directly from the POKE_API_URL.

About

Caches api requests locally

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages