hackernews-sandbox
A dead-simple sinatra sandbox for Hacker News API
Install
$ bundle install
Run
$ ruby server.rb -o 0.0.0.0
Test
- http://localhost:4567/v0/topstories.json
- http://localhost:4567/v0/newstories.json
- http://localhost:4567/v0/showstories.json
- http://localhost:4567/v0/askstories.json
- http://localhost:4567/v0/item/1.json
- http://localhost:4567/v0/item/9019505.json
Switch to another sandbox dataset
- http://localhost:4567/_sandbox/empty
- http://localhost:4567/v0/topstories.json ->
[ ]
- http://localhost:4567/v0/item/1.json ->
null
- http://localhost:4567/_sandbox/default
Sandbox responses are located under /responses/<dataset>
, e.g. /response/default
, with paths matching corresponding URL segments.