Created
July 3, 2018 21:00
-
-
Save msfidelis/f406d7dbc962f95bc0f879ee24b33548 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = app => { | |
app.get('/pets', (req, res) => { | |
res.status(200).send({message: 'listing pets'}); | |
}); | |
app.post('/pets', (req, res) => { | |
res.status(201).send({message: 'creating a pet'}); | |
}); | |
app.put('/pets/:id', (req, res) => { | |
const id = req.params.id; | |
res.status(200).send({message: `update pet ${id}`}); | |
}); | |
app.delete('/pets/:id', (req, res) => { | |
const id = req.params.id; | |
res.status(204).send({message: `delete pet ${id}`}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment