A simple node proxy for manipulating API responses
JavaScript Shell Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.rvmrc
Gemfile
README.mediawiki
node_backend.js
proxy.js
sinatra_backend.rb
start.sh
stop.sh
test.sh

README.mediawiki

Setup:

  npm install

Boot with

  ./stop.sh # WARNING this uses killall and isn't super safe
  ./start.sh

Test with

  curl -i --header "Host: ruby" localhost:9000/cache_headers
  curl -i --header "Host: node" localhost:9000/cache_headers

or

  ./test.sh

Functionality:

  Base data
  curl --header Host: node localhost:9000/cache_headers
  { "key1": "value1", "key2": "value2" }
  
  1 key
  curl --header Host: node localhost:9000/cache_headers?fields=key1
  {"key1":"value1"}
  
  Multiple keys
  curl --header Host: node localhost:9000/cache_headers?fields=key1,key2
  {"key1":"value1","key2":"value2"}