Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gonzalo-bulnes/dredd-rack-rails-example
Demonstrate the Dredd::Rack usage in a Rails app.
https://github.com/gonzalo-bulnes/dredd-rack-rails-example
demo dredd-rack rails
Last synced: 28 days ago
JSON representation
Demonstrate the Dredd::Rack usage in a Rails app.
- Host: GitHub
- URL: https://github.com/gonzalo-bulnes/dredd-rack-rails-example
- Owner: gonzalo-bulnes
- Created: 2015-05-13T03:43:20.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-20T02:47:29.000Z (over 9 years ago)
- Last Synced: 2024-10-09T09:38:37.272Z (about 1 month ago)
- Topics: demo, dredd-rack, rails
- Language: Ruby
- Size: 173 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Dredd::Rack Rails Example
=========================Demonstrate the [Dredd::Rack][dredd-rack] usage in a Rails app.
[dredd-rack]: https://github.com/gonzalo-bulnes/dredd-rack
Usage
-----```bash
# run the app
rackup -p 3000
```### How-to add Dredd::Rack to a Rails application
1. Store the API blueprints in the `doc` directory, with the `.apib` or `.apib.md` extension
1. Install Dredd::Rack (see the [Dredd::Rack documentation][dredd-rack])
1. Add the `dredd` task to your `Rakefile`Example:
```ruby
# Gemfilegem 'dredd-rack', '0.5.0'
``````ruby
# Rakefile# ...
require 'dredd/rack'
Dredd::Rack::RakeTask.new # run with `rake dredd`
# Optionally, add :dredd to the default task
task default: :dredd # run with `rake`
``````ruby
# config/initializers/dredd_rack.rbDredd::Rack.app = Rails.application # put here the name of your app
```That's all!
Documentation
-------------See the [Dredd::Rack Rails Example API blueprint][doc] (`doc/app.apib.md`) for an always up-to-date documentation of this example API. Note how the `.apib.md` extension allows to read the documentation on Github : )
[doc]: doc/app.apib.md
Development
-----------```bash
# run the app
rerun 'rackup --port=3000'
```