Files
habitica/website/src/controllers/api-v3/example.js
2015-11-17 16:48:50 +01:00

35 lines
711 B
JavaScript

// 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',
middlewares: [],
handler (req, res) {
res.status(200).send({
status: 'ok',
});
},
};
export default api;