Pure JRuby implementation of the HTTP Requests Example using Sinatra.
- Install dependencies
$ bundle install
-
Install PostgreSQL and start server locally
-
Set up database:
$ createdb jruby_ratpack_example
- Initialize database schema
$ bundle exec rake db:init
- Populate database with seed data
$ bundle exec rake db:seed
-
Start the server
$ bin/server # curl or visit in browser: http://localhost:5050 # endpoints: http://localhost:5050/music # db call http://localhost:5050/planets # http request to external api http://localhost:5050/* # 404
-
Start the server using a local planets API
$ PLANETS_URL="http://localhost:3000/planets" bin/server