Skip to content

Commit

Permalink
Including http-status-code as base codes (v1.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioBeneditto committed Feb 24, 2022
1 parent 9f5ad6b commit 6b7e86b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ app.post('/', (req, res) => {
app.get('/api', (req, res) => {
statusId = 200;
res.json(
{'message': 'Return to API request: ' + statusId, allStatus}
{
'code': statusId,

}
)
})

Expand All @@ -41,8 +44,8 @@ app.param('id', function (req, res, next, id) {
app.get('/api/:id', function (req, res) {
res.json(
{
'message': 'Return to API request: ' + statusId,
'status': HTTPStatusCode.getMessage(statusId)
'code': statusId,
'message': HTTPStatusCode.getMessage(statusId)
}
)
res.end()
Expand Down

0 comments on commit 6b7e86b

Please sign in to comment.