This is a simple example of a CRUD API using Rails and Grape. The API consists of two resources: users
and posts
. Users can have many posts. If a user is deleted, all of their posts are deleted as well.
GET /users
- List all usersGET /users/:id
- Show a userGET /users/:id/posts
- Show a user's postsGET /users/:id/picture
- Get user's secure picture urlGET /users/dump
- Dump all users to a XLSX filePOST /users
- Create a userPOST /users/:id/picture
- Upload a user's picturePUT /users/:id
- Update a userDELETE /users/:id
- Delete a user
GET /posts
- List all postsGET /posts/:id
- Show a postPOST /posts
- Create a postPUT /posts/:id
- Update a postDELETE /posts/:id
- Delete a post
GET /faraday/posts
- List all postsGET /faraday/comments
- List all comments