0.1.1 • Published 5 years ago

caching-proxy2 v0.1.1

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

Caching Proxy

A Proxy server that caches responses in filesystem that really works

  • Need to test against a remote API and have a slow connections?
  • The service has no CORS enabled so you can query it from localhost?

Solution: Cache it in a local server

Install

npm install caching-proxy2

or globally:

npm install -g caching-proxy2

Usage

Imaging you are consuming an API like http://api.server.com/v2/sources/19/series?format=json and now want to cache all requests there locally or just enable CORS. Start caching-server, use the same urls, just change the server name;

npx caching-proxy2 --hostName "http://api.server.com" --port 9000

And now instead of consuming http://api.server.com/v2/sources/19/series?format=json, point your client to http://localhost:9000/v2/sources/19/series?format=json

and voila!