Svcbase
This is a base class for Grape apps following our API methodology.
It includes
- API Logging, including sensitive data filtering and periodic stat output
- Configuration (file) support
- Locale support
- API request helpers for common data
- Request ID tracking
Installation
Add this line to your application's Gemfile:
gem 'svcbase'
And then execute:
$ bundle
Or install it yourself as:
$ gem install svcbase
Usage
You can reference the entire stack by simply doing a
require 'svcbase'
but it is recommended that only the relevant parts are required. For example, to start the behind-the-scenes thread server, simply
require 'svcbase/server'
and then later reference ``` Core::Server.
To create a new top-level API, first
```ruby
require 'svcbase/api/base'
and then create a class that inherits from ``` Core::APIBase
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`.