Add this line to your application's Gemfile:
gem 'petit'
And then execute:
$ bundle
Or install it yourself as:
$ gem install petit
Petit is designed to be a Twelve Factor app and therefore all configuration should be done using environment variables.
To use the default DynamoDB you'll need all of the AWS credentials.
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
- DB_TABLE_NAME (Name of the database to create/use)
- API_BASE_URL (Ususally a HTTPS address with some security applied)
- SERVICE_BASE_URL (Public base URL like 'http://bit.ly' )
- NOT_FOUND_DESTINATION (Optional Address where public requests that result in 404 will be sent.)
The default installation of petit relies on DynamoDB. (This can be replaced if you have the need.) In order to bootstrap the application you will need to ensure that the database has been created in your AWS account. An idempotent rake task exists in the rakefile under db:setup. After the environment variables have been set, you can run rake db:setup to set up the requisite DynamoDB database on your AWS account.
Since DynamoDB doesn't require fields to be explicitly created or destroyed migrations are not currently needed or supported.
This is an open-source project built by ECHO, an international nonprofit working to help those who are teaching farmers around the world know how to be more effective in producing enough to meet the needs of their families and their communities. ECHO is an information hub for international development practitioners specifically focused on sustainable, small-scale, agriculture. Through educational programs, publications, and networking ECHO is sharing solutions from around the world that are solving hunger problems.
Charity Navigator ranks ECHO as the #1 International Charity in the state of Florida (where their US operations are based) and among the top 100 in the US.
Thanks to grants and donations from people like you, ECHO is able to connect trainers and farmers with valuable (and often hard-to-find) resources. One of ECHO's greatest resources is the network of development practitioners, around the globe, that share help and specialized knowledge with each other. ECHO uses the YourMembership product to help facilitate these connections.
To find out more about ECHO, or to help with the work that is being done worldwide please visit http://www.echonet.org
If you find a problem with this code or would like to contribute an improvement please fork and submit a pull request.
If you're a developer that would like to help solve world hunger problems with some of your spare time, we are always looking for talented volunteers. Contact Nate Flood by email: nate [at] echonet [dot] org
- Fork it ( https://github.com/ECHOInternational/petit/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