Skip to content

Commit

Permalink
feat: Added overviews endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Nino van Galen committed Apr 21, 2020
1 parent 8e1c15a commit 57b64bb
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/lib/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

const HomeController = require('./home.controller');
const OverviewsController = require('./overviews.controller');
const UsersController = require('./users.controller');
const TagsController = require('./tags.controller');
const SettingsController = require('./settings.controller');
Expand All @@ -25,6 +26,7 @@ const RunsController = require('./runs.controller');

module.exports = {
HomeController,
OverviewsController,
RunsController,
SettingsController,
SubsystemsController,
Expand Down
43 changes: 43 additions & 0 deletions backend/lib/controllers/overviews.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* This file is part of the ALICE Electronic Logbook v2, also known as Jiskefet.
* Copyright (C) 2020 Stichting Hogeschool van Amsterdam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/**
* Get all overviews.
*
* @param {Object} request The *request* object represents the HTTP request and has properties for the request query
* string, parameters, body, HTTP headers, and so on.
* @param {Object} response The *response* object represents the HTTP response that an Express app sends when it gets an
* HTTP request.
* @param {Function} next The *next* object represents the next middleware function which is used to pass control to the
* next middleware function.
* @returns {undefined}
*/
const index = (request, response, next) => {
response.status(501).json({
errors: [
{
status: '501',
title: 'Not implemented',
},
],
});
};

module.exports = {
index,
};
2 changes: 2 additions & 0 deletions backend/lib/routers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

const homeRoute = require('./home.router');
const overviewRoute = require('./overviews.router');
const runsRoute = require('./runs.router');
const settingsRoute = require('./settings.router');
const subsystemsRoute = require('./subsystems.router');
Expand All @@ -26,6 +27,7 @@ const { appendPath, deepmerge } = require('../utils');

const routes = [
homeRoute,
overviewRoute,
runsRoute,
settingsRoute,
subsystemsRoute,
Expand Down
26 changes: 26 additions & 0 deletions backend/lib/routers/overviews.router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* This file is part of the ALICE Electronic Logbook v2, also known as Jiskefet.
* Copyright (C) 2020 Stichting Hogeschool van Amsterdam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

const { OverviewsController } = require('../controllers');

module.exports = {
method: 'get',
path: '/overviews',
controller: OverviewsController.index,
args: { public: true },
};

0 comments on commit 57b64bb

Please sign in to comment.