Setting Rails Grape API

gem 'grape', '~> 1.0', '>= 1.0.3'
gem 'grape-swagger', '~> 0.30.1'
gem 'grape-swagger-rails', '~> 0.3.0'
gem 'rack-cors', :require=>'rack/cors'
config.middleware.insert_before 0, Rack::Cors do
allow do
origins '*'
resource '*', :headers=>:any, :methods=>[:get, :post, :delete, :options]
end
end
ActiveSupport::Inflector.inflections(:en) do |inflect|
inflect.acronym 'API'
end
Rails.application.routes.draw do
mount VersioningGrape::API => '/api'
mount GrapeSwaggerRails::Engine => '/swagger'
end
//= link grape_swagger_rails/application.css
//= link grape_swagger_rails/application.js

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store