aboutsummaryrefslogtreecommitdiff
path: root/server/routes
diff options
context:
space:
mode:
Diffstat (limited to 'server/routes')
-rw-r--r--server/routes/api.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/routes/api.js b/server/routes/api.js
index 3684aa0..a0890a7 100644
--- a/server/routes/api.js
+++ b/server/routes/api.js
@@ -1,8 +1,13 @@
const express = require('express');
const router = express.Router();
+const passport = require('passport');
const exampleController = require('../controllers/example');
+const userController = require('../controllers/user');
router.get('/', exampleController.index);
+router.get('/protected', passport.authenticate('jwt', {session: false}), exampleController.index);
+router.post('/register', userController.register);
+router.post('/login', userController.login);
module.exports = router;