Sha256: da932b8ba6410147b79dd5476072d4d14d004c36d480a3dc63471a07921c4f59

Contents?: true

Size: 1.63 KB

Versions: 1

Compression:

Stored size: 1.63 KB

Contents

# Swagui

a Rack middleware app and a command-line utility that helps you render [swagger-ui], a great api documentation tool, with ease and grace.

## Install
Add this line to your application's Gemfile:

```ruby
group :development do
  gem 'swagui'
end
```

## Usage

### Rack middleware

In your `application.rb` (for Rails app) or `config.ru` (for Rack app), add Swigui middleware close to the top of the middleware stack. For example, in a `config.ru` file, add the following line:

```ruby
if Rack.env == 'development'
  use Swagui::App, url: '/doc', path: 'doc'
end
```

* `url`: the url path to access the [swagger-ui].
* `path`: the sub-directory name where the swagger files are stored. It assumes that `api-docs` is the index file in the directory.

You will be able to access the [swagger-ui] loaded with your api documentation at `/doc` (your `url` setting) when the server starts.

### Command-line utility

Sometimes, you only want to see the documentation without starting the entire application. All you need to do is to run the following command in your documentation directory:

    $ bundle exec swagui

optionally, you can specify the directory name as a command line argument:

    $ bundle exec swagui doc

You will then able to view the [swagger-ui] loaded with your api documentation at `http://localhost:9292`

[swagger-ui]: https://github.com/wordnik/swagger-ui

## Contributing

1. Fork it ( https://github.com/jackxxu/swagui/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
swagui-0.1.1 README.md