- This is a Ruby on Rails application
- This application was generated with the rails_apps_composer gem
- It requires ruby 2.1.2
- It requires rails 4.1.5
- There is one test which requires the selenium driver, so the latest version of Firefox is required.
- Data store is sqlite
- It's tested with Rspec
This is a simple API with two end points for CREATING and SHOWING Notes.
Creating and Showing notes requires a password. Passwords are hash salted, and the content of the notes are encrypted with the password as the encryption key.
I created a UI on the root of the app for interfacing with the API. There's some JS in there. Soz about that.
Glad you asked.
post /api/v1/notes, {:password, :title, :body}
Required Parameters
- :password
Example
post /api/v1/notes, {password:'secret', title:'a title', body: 'a body'}
Response
{
"id": 13,
"title": "a title",
"body": "a body"
}
get /api/v1/:id, {:password}
Required Parameters
- :id
- :password
Example
get /api/v1/notes/13, {password:'secret'}
Response
{
"id": 13,
"title": "a title",
"body": "a body"
}
Make sure you've got all the requirements (see first section above).
$ bundle install
$ rake db:migrate
$ rspec
$ rails s
Then browse to http://localhost:3000/