Skip to content
Get to API building quickly
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app fix rails 5 devise issue Oct 26, 2017
bin
config
db
lib Style improvements (#6) Oct 12, 2016
log initial commit Feb 22, 2015
public
spec Rails 5 (#7) Oct 26, 2017
vendor/assets
.env.sample
.gitignore bump gitignore Sep 3, 2018
.rspec initial commit Feb 22, 2015
.rubocop.yml
.travis.yml Rails 5 (#7) Oct 26, 2017
Gemfile Rails 5 (#7) Oct 26, 2017
Gemfile.lock Rails 5 (#7) Oct 26, 2017
Guardfile
LICENSE initial commit Feb 22, 2015
Procfile
Procfile_development revise start method Oct 26, 2017
README.markdown
Rakefile initial commit Feb 22, 2015
app.json initial commit Feb 22, 2015
config.ru revise start method Oct 26, 2017
start revise start method Oct 26, 2017

README.markdown

Grape-Doorkeeper

Create an awesome versioned API, secured with OAuth2 and automatically documented.

This is a basic Rails 5 application with Doorkeeper, Grape & Swagger for getting to API building quickly.

You can view the live app and the Swagger-ui documentation.

This app is ready to deploy to Heroku Deploy

Set up

This app includes omniauth-bike-index. For Bike Index login to work, create a Bike Index app at BikeIndex.org/oauth/applications/new and add the values from BIKEINDEX_APP_ID and BIKEINDEX_APP_SECRET to the .env file.

Bike Index uses a similar grape, Swagger, doorkeeper setup—this is an example of creating an OmniAuth strategy for doorkeeper.

Adding to an existing application

View how to on the wiki.

Notes

Grape is mounted in app/controllers/api, as described in the excellent Introduction to building APIs with Grape by Monterail, and part 2 of the series.

There are are other posts in the series which are worth reading, particularly OAuth Implicit Grant with Grape, Doorkeeper and AngularJS.

There is also a Railscast on doorkeeper.

Important things in the Gemfile:

Also important, but maybe not as necessary to know about:


If you want to change the name of the app, swap out:

Testing

Rspec and guard - run bundle exec guard to watch your spec files for changes and rerun tests for those files.

There is a spec for the api/v1/me API route and for the swagger docs to help get you started.

You can’t perform that action at this time.