Giter Site home page Giter Site logo

busteraph / grape-doorkeeper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sethherr/grape-doorkeeper

1.0 2.0 0.0 89 KB

Get to API building quickly

Home Page: https://grape-doorkeeper.herokuapp.com

License: MIT License

Ruby 68.44% JavaScript 0.27% CoffeeScript 3.07% CSS 5.16% HTML 23.06%

grape-doorkeeper's Introduction

Grape-Doorkeeper

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

This is a basic Rails 4 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

First bundle install and rake db:setup

Run rake start to get the server running locally. It runs at http://localhost:3001

You will want to change config/initializers/secret_token.rb and export DEVISE_SECRET_KEY (see config/initializers/devise.rb).

You will also probably want to delete the imaginary item class and serializer, which are included for demonstration in the me/items endpoint.

This app includes omniauth-bike-index. For Bike Index login to work, export environment variables BIKEINDEX_APP_ID and BIKEINDEX_APP_SECRET. You'll need a Bike Index app, which you can create at BikeIndex.org/oauth/applications/new.

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.

grape-doorkeeper's People

Contributors

sethherr avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.