Giter Site home page Giter Site logo

grape_example_app's Introduction

Grape Example App

Deploy to Heroku

This application was generated with the rails_apps_composer gem provided by the RailsApps Project.

Rails Composer is open source and supported by subscribers. Please join RailsApps to support development of Rails Composer.

Ruby on Rails

This application requires:

  • Ruby 2.2.2
  • Rails 4.2.4

Learn more about Installing Rails.

About

This is an example of an Rails API made with Grape. Was created with Rails Composer from the RailsApps project.

Original author

Iván González, a.k.a dreamingechoes

Getting Started

To start using this API, you only have to do the typical Rails things:

  • Install Ruby version 2.2.2 (using RVM or RBenv or whatever).

  • Clone the repo and do the bundle install thing:

user@computer:~$ git clone [email protected]:dreamingechoes/grape_example_app.git
user@computer:~$ cd grape_example_app
user@computer:/grape_example_app$ bundle install
user@computer:/grape_example_app$ rake db:setup
  • When all this finish, you're ready to launch the app!
user@computer:/grape_example_app$ rails s

NOTE: the seed.rb file has an ApiKey example token for testing the API, which is 18dfef7acf97765b54abecdf86a25bba, but on ApiKey.create() method it assigns other random access_token. If you want to use the example token for testing purpose, update via console the attribute access_token of the ApiKey to 18dfef7acf97765b54abecdf86a25bba, like this:

user@computer:/grape_example_app$ rails console
Loading development environment (Rails 4.2.4)
>> a = ApiKey.first
  ApiKey Load (0.3ms)  SELECT  `api_keys`.* FROM `api_keys`  ORDER BY `api_keys`.`id` ASC LIMIT 1
=> #<ApiKey id: 2, access_token: "k93eeqa34f9774rko4abecdf86a2nckm", expires_at: "2043-03-12 21:03:46", user_id: 3, active: nil, created_at: "2015-10-26 21:03:46", updated_at: "2015-10-26 21:05:03">
>> a.update_attribute(:access_token, "18dfef7acf97765b54abecdf86a25bba")
   (1.8ms)  BEGIN
   (0.1ms)  COMMIT
=> true

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Grape Example App is released under the MIT License.

grape_example_app's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.