diff --git a/README.md b/README.md index 84470984b279191099440f6120dec3650037e2c7..5aab95c1574e977c44c3065a5e7314fa814c9a15 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/backend/routes/auth.js b/backend/routes/auth.js index a4fa60e3bf5f0bc161b30844766a3450fe75a9b9..408b34361bc6f01405652817beaba584dd2ec66a 100644 --- a/backend/routes/auth.js +++ b/backend/routes/auth.js @@ -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;