Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gonzalo-bulnes/dredd-rack-sinatra-example
Demonstrate the Dredd::Rack usage in a Sinatra app.
https://github.com/gonzalo-bulnes/dredd-rack-sinatra-example
demo dredd-rack sinatra
Last synced: 16 days ago
JSON representation
Demonstrate the Dredd::Rack usage in a Sinatra app.
- Host: GitHub
- URL: https://github.com/gonzalo-bulnes/dredd-rack-sinatra-example
- Owner: gonzalo-bulnes
- Created: 2015-03-15T17:15:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-13T04:32:48.000Z (over 9 years ago)
- Last Synced: 2024-10-21T19:02:14.320Z (26 days ago)
- Topics: demo, dredd-rack, sinatra
- Language: Ruby
- Size: 163 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Dredd::Rack Sinatra Example
===========================Demonstrate the [Dredd::Rack][dredd-rack] usage in a Sinatra app.
[dredd-rack]: https://github.com/gonzalo-bulnes/dredd-rack
Usage
-----### Run the app
```bash
# run the app
rackup --port=4567
```### Verify that the application complies with its API blueprint
```bash
# validate the API against its blueprint
rake dredd
```Please do notice that there is no need to run the application to verify its blueprint.
### How-to add Dredd::Rack to a Sinatra 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.app = Dredd::Rack::Sinatra::Example # put here the name of your app
Dredd::Rack::RakeTask.new # run with `rake dredd`# Optinally, add :dredd to the default task
task default: :dredd # run with `rake`
```That's all!
Documentation
-------------See the [Dredd::Rack Sinatra 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