Routes - npartovi/Destructables GitHub Wiki
HTML ROUTES
GET / StaticPagesController#root
API ROUTES
Users
GET /api/users
- returns users information
GET /api/users/:id
- returns specific user for user profile page
POST /api/users
- creates new user
Session
POST /api/session
- login
DELETE /api/session
- logout
Articles
GET /api/articles
- returns articles - will prob use for search bar as well
GET /api/articles/:id
- returns specific article and relevant information
POST /api/articles
- creates a new article
PATCH /api/articles/:id
- edits an existing article
DELETE /api/articles/:id
- deletes a article based on id
Steps
POST /api/articles/:article_id/steps
- creates a new step
GET /api/articles/:article_id/steps
- returns the steps for a specific article
PATCH /api/steps/:id
- edits a step
DELETE /api/steps/:id
- deletes a step
Comments
POST /api/articles/:article_id/comments
- creates a new comment
PATCH /api/comments/:id
- edits a comment based on id
DELETE /api/comments/:id
- deletes a comment based on id
Front End Routes
/
- render home page
/signup
- render signup form
/login
- render login form
/user/:id
- user profile show page
/article/new
- creates new article
/article/:id - article show page
- renders article contents
/article/:id/edit
- edit article page
/feature - shows articles sorted by highest likes
- renders page with articles sorted by likes