diff --git a/backend/lib/routers/index.js b/backend/lib/routers/index.js index 397cab8970..31d7fde1aa 100644 --- a/backend/lib/routers/index.js +++ b/backend/lib/routers/index.js @@ -17,14 +17,16 @@ */ const apiRoute = require('./home.router'); -const userRoute = require('./users.router'); +const subsystemsRoute = require('./subsystems.router'); const tagsRoute = require('./tags.router'); +const usersRoute = require('./users.router'); const { appendPath, deepmerge } = require('../utils'); const routes = [ apiRoute, - userRoute, + subsystemsRoute, tagsRoute, + usersRoute, ]; /** diff --git a/backend/lib/routers/subsystems.router.js b/backend/lib/routers/subsystems.router.js new file mode 100644 index 0000000000..892b550289 --- /dev/null +++ b/backend/lib/routers/subsystems.router.js @@ -0,0 +1,33 @@ +/** + * 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 . + */ + +const { SubsystemController } = require('../controllers'); + +module.exports = { + method: 'get', + path: 'subsystems', + controller: SubsystemController.index, + args: { public: true }, + children: [ + { + method: 'get', + path: '/:id', + controller: SubsystemController.read, + }, + ], +};