From 1667e801098e334e30b5c8a19919084f6063b42e Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Fri, 17 Aug 2018 06:39:55 +0000 Subject: [firstregistration] First start of the new client registration Router now also can use non auth methods. (Used for the registration calls) Added ipxe scripts for the registration Added backend methods for dynamic ipxe scripts and first try of a dhcp api call --- server/router.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'server/router.js') diff --git a/server/router.js b/server/router.js index 062618d..6070f33 100644 --- a/server/router.js +++ b/server/router.js @@ -11,13 +11,12 @@ router.post('/signup', auth.signup) router.post('/logout', auth.logout) router.post('/changepassword', auth.changePassword) -// Public callable functions. -var ipxe = require(path.join(__dirname, 'api', 'ipxe')) -router.get('/ipxe/loadScript', ipxe.get.loadScript) - // Forward routing to every api module with //... fs.readdirSync(path.join(__dirname, 'api')).forEach(filename => { var api = require(path.join(__dirname, 'api', filename)) + // Public callable functions. + if (api.noAuthRouter) router.use('/' + filename.split('.')[0] + '/', api.noAuthRouter) + // Authentication needed if (api.router) router.use('/' + filename.split('.')[0] + '/', auth.verifyToken, api.router) }) -- cgit v1.2.3-55-g7522