mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
add example apidoc comments, add notFound middleware
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user