mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
add example controller and lib to setup routes
This commit is contained in:
15
website/src/controllers/api-v3/example.js
Normal file
15
website/src/controllers/api-v3/example.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// An example file to show how a controller should be structured
|
||||
let api = {};
|
||||
|
||||
api.exampleRoute = {
|
||||
method: 'GET',
|
||||
url: '/example/:param',
|
||||
middlewares: [],
|
||||
handler (req, res) {
|
||||
res.status(200).send({
|
||||
status: 'ok'
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default api;
|
||||
Reference in New Issue
Block a user