Backend to the Lambda School Expat Journal
These are our current endpoints:
GET /api/users/:id
- gets user by IDGET /api/stories/:id/photos
- gets all photos for a storyGET /api/photos/:id
- gets photo by IDPOST /api/auth/register
- adds a new userPOST /api/auth/login
- authenticates the userPOST /api/users/:id/stories
- adds a new storyPOST /api/stories/:id/photos
- adds a new photo to the storyPUT /api/users/:id
- updates a users info by idPUT /api/stories/:id
- updates a given scheme by idPUT /api/photos/:id
- updates a given scheme by idDELETE /api/users/:id
- removes a user by idDELETE /api/stories/:id
- removes a story by idDELETE /api/photos/:id
- removes a photo by id
example of what a post to /api/stories/:id/photos
would expect
{photo_url: 'https://images.unsplash.com/photo-1476514525535-07fb3b4ae5f1?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80', photo_title: "Lago di Braies, Italy", photo_description: "On a boat in Lago di Braies"},
example of what a post to /api/users/:id/stories
would expect
{story_name: 'My trip to Italy', story_description: "It was a fun trip made a lot of freinds."},
example of what a post to /api/auth/login
&& /api/auth/login
would expect
{username: 'bill', password: "password"}