A simple example Grape Api mounted on rack without using an ORM. #Instructions
- Run the follwing commands to get started
- rake db:create
- rake db:seed
- rake testprep
- rackup
- You can then visit the api at the following endpoints
http://localhost:9292/v1/records/first_name - this give you a list of all users sorted by first name
http://localhost:9292/v1/records/last_name - this gives you a list of all users sorted by last name
http://localhost:9292/v1/records/created_at - this gives you a list of all users sorted by created at date
- You can also make a post request using curl like so:
curl -X POST "http://localhost:9292/v1/records/first_name,last_name,email,phone,created_at"
#Other Stuff
-
Run 'rake spec' to run the specs
-
Run 'rake db:drop' to delete the database