add example apidoc comments, add notFound middleware

This commit is contained in:
Matteo Pagliazzi
2015-11-17 16:48:50 +01:00
parent 61948e1ca5
commit aa1b046cf2
9 changed files with 102 additions and 21 deletions

View File

@@ -1,6 +1,25 @@
// An example file to show how a controller should be structured
let api = {};
/**
* @api {get} /example/:id Request Example information
* @apiName GetExample
* @apiGroup Example
*
* @apiParam {Number} id Examples unique ID.
*
* @apiSuccess {String} firstname Firstname of the Example.
* @apiSuccess {String} lastname Lastname of the Example.
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "firstname": "John",
* "lastname": "Doe"
* }
*
* @apiUse NotFound
*/
api.exampleRoute = {
method: 'GET',
url: '/example/:param',
@@ -12,4 +31,4 @@ api.exampleRoute = {
},
};
export default api;
export default api;