Skip to content
Snippets Groups Projects
Commit 0ff117ba authored by Baptiste CERDAN's avatar Baptiste CERDAN
Browse files

:sparkles: add students list on API

parent 3a48ad9a
Branches
1 merge request!7:sparkles: add students list on API
......@@ -9,11 +9,13 @@ Features the following REST endpoints:
- **/api/login**
- **/api/pay_adhesion**
- **/api/pay_adhesion** (POST) body : {"student_number" : 12345678}
- **/api/me**
- **/api/me/update**
- **/api/etudiants** (GET)
## Development
- Run `npm start`, server will run at `http://localhost:8005` and MongoDB `http://localhost:27017`
......@@ -141,4 +141,9 @@ router.post('/me/update', passport.authenticate('jwt', {session: false}), async
res.status(200).json();
});
router.get('/etudiants', async (req, res) => {
const users = await User.find();
return res.status(200).json(users);
});
module.exports = router;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment