summaryrefslogtreecommitdiffstats
path: root/server/router.js
diff options
context:
space:
mode:
authorJannik Schönartz2018-08-17 08:39:55 +0200
committerJannik Schönartz2018-08-17 08:39:55 +0200
commit1667e801098e334e30b5c8a19919084f6063b42e (patch)
tree532630c936cb5c7395b658faf24319a4bd7e0201 /server/router.js
parent[server/router] Fix eslint errors (diff)
downloadbas-1667e801098e334e30b5c8a19919084f6063b42e.tar.gz
bas-1667e801098e334e30b5c8a19919084f6063b42e.tar.xz
bas-1667e801098e334e30b5c8a19919084f6063b42e.zip
[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
Diffstat (limited to 'server/router.js')
-rw-r--r--server/router.js7
1 files changed, 3 insertions, 4 deletions
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 /<api>/...
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)
})