Rails API for crowdsourced voter canvassing.
- Clone the repository (
git clone [email protected]:Bernie-2016/fieldthebern-api.git
) - Install gem dependencies:
bundle install
- Create and migrate the database:
rake db:setup
- Copy
.env.sample
to.env
. Create test apps with the relevant services to get credentials. - Run
gem install foreman
to install the foreman gem, used for running Procfile-based apps. - Run
foreman start
to start the server.
http://api.lvh.me:5000/ping
You must set ENV['MIN_INTERVAL_BETWEEN_VISITS_HOURS']
to at least 1
for specs to pass.
{
"errors": [
{
"id": "DASHERIZED_CAPITALIZED_ERROR_NAME",
"title": "User friendly error name",
"detail": "Value of Error.message",
"status": "HTTP_CODE_IN_INTEGER_FORMAT"
}
]
}
This format is consistent with the JSON API specification for errors. The root object should be called "errors". It should be an array, even if it's just a single error, which is our case.
- Fork it ( https://github.com/Bernie-2016/fieldthebern-api/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request