Grape::API1 is an awesome tool for building APIs in Ruby – it’s quick 2 and has a nice DSL with some lovely features. One major issue with it comes whilst developing the application – there is no built in reloading of classes, and whilst there are a couple of threads about implementing reloading3, there’s no progress as yet.
Fortunately, Grape is Rack-based, which allows us to use Shotgun4 as a development server, which handles reloading for us. Simply add a
to your Gemfile to give yourself a copy of Shotgun in development mode, run
and then you’ll be able to start your app by running
Visit http://localhost:9393/[your path here], make some changes and refresh to see your changes working, and a major headache gone!