Skip to content

Instantly share code, notes, and snippets.

@niamurrell
Last active July 23, 2017 19:51
Show Gist options
  • Save niamurrell/eb80dff74e6af2d93a2283f275a267bc to your computer and use it in GitHub Desktop.
Save niamurrell/eb80dff74e6af2d93a2283f275a267bc to your computer and use it in GitHub Desktop.

Revisions

  1. niamurrell revised this gist Jul 23, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion restful.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    Name | URL | Request Type | Description | MongoDB Method | Sequelize Method |
    Name | URL | Request Type | Description | MongoDB Method | [Sequelize Method](https://github.com/kissmygritts/coding-challenge/blob/master/week5-express-sequelize/restful-sequelize.js) |
    --- | --- | --- | --- | --- | --- |
    INDEX | /posts | GET | Display list of all posts | Post.find() | Post.findAll() |
    NEW | /posts/new | GET | Display form to make new post | n/a | n/a |
  2. niamurrell revised this gist Jul 23, 2017. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions restful.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    Name | URL | Request Type | Description | MongoDB Method |
    --- | --- | --- | --- | --- |
    INDEX | /posts | GET | Display list of all posts | Post.find() |
    NEW | /posts/new | GET | Display form to make new post | n/a |
    CREATE | /posts | POST | Add new post to database | Post.create() |
    SHOW | /posts/:id | GET | Show info about specific post | Post.findById() |
    EDIT | /posts/:id/edit | GET | Show edit form for specific post | Post.findById() |
    UPDATE| /posts/:id | PUT | Update specific post & reroute to edited post | Post.findByIdAndUpdate() |
    DESTROY | /posts:id | DELETE | Delete specific post & reroute | Post.findByIdAndRemove() |
    Name | URL | Request Type | Description | MongoDB Method | Sequelize Method |
    --- | --- | --- | --- | --- | --- |
    INDEX | /posts | GET | Display list of all posts | Post.find() | Post.findAll() |
    NEW | /posts/new | GET | Display form to make new post | n/a | n/a |
    CREATE | /posts | POST | Add new post to database | Post.create() | Post.create() |
    SHOW | /posts/:id | GET | Show info about specific post | Post.findById() | Post.findById() |
    EDIT | /posts/:id/edit | GET | Show edit form for specific post | Post.findById() | Post.findById() |
    UPDATE| /posts/:id | PUT | Update specific post & reroute to edited post | Post.findByIdAndUpdate() | Post.update() |
    DESTROY | /posts:id | DELETE | Delete specific post & reroute | Post.findByIdAndRemove() | Post.destroy() |


    created by @[niamurrell](https://www.github.com/niamurrell)
  3. niamurrell revised this gist Jul 23, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion restful.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    Name | URL | Request Type | Description | MongoDB method |
    Name | URL | Request Type | Description | MongoDB Method |
    --- | --- | --- | --- | --- |
    INDEX | /posts | GET | Display list of all posts | Post.find() |
    NEW | /posts/new | GET | Display form to make new post | n/a |
  4. niamurrell created this gist Jul 23, 2017.
    12 changes: 12 additions & 0 deletions restful.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    Name | URL | Request Type | Description | MongoDB method |
    --- | --- | --- | --- | --- |
    INDEX | /posts | GET | Display list of all posts | Post.find() |
    NEW | /posts/new | GET | Display form to make new post | n/a |
    CREATE | /posts | POST | Add new post to database | Post.create() |
    SHOW | /posts/:id | GET | Show info about specific post | Post.findById() |
    EDIT | /posts/:id/edit | GET | Show edit form for specific post | Post.findById() |
    UPDATE| /posts/:id | PUT | Update specific post & reroute to edited post | Post.findByIdAndUpdate() |
    DESTROY | /posts:id | DELETE | Delete specific post & reroute | Post.findByIdAndRemove() |


    created by @[niamurrell](https://www.github.com/niamurrell)