diff --git a/README.md b/README.md index 5aab95c1574e977c44c3065a5e7314fa814c9a15..288a298c54f6d6231968c0488f65034d6dbc4747 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Student Part - ERP 2021 -## Baptiste CERDAN, Victor VOGT, Thomas STEINMETZ, Janos FALKE +### Baptiste CERDAN, Victor VOGT, Thomas STEINMETZ, Janos FALKE -## REST endpoints +### REST endpoints Features the following REST endpoints: - **/api/signup** @@ -17,5 +17,5 @@ Features the following REST endpoints: - **/api/etudiants** (GET) -## Development -- Run `npm start`, server will run at `http://localhost:8005` and MongoDB `http://localhost:27017` +### Development +- Run `docker-compose up --build`, 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 408b34361bc6f01405652817beaba584dd2ec66a..f3bba0603d2cd1209a447c2a84b74bbba4091c8f 100644 --- a/backend/routes/auth.js +++ b/backend/routes/auth.js @@ -73,6 +73,9 @@ router.post('/login', async (req, res) => { router.post('/pay_adhesion', async (req, res) => { const student_number = req.body.student_number; + res.header("Access-Control-Allow-Origin", "*"); + res.header("Access-Control-Allow-Headers", "X-Requested-With"); + if (!student_number) return res.status(400); @@ -143,6 +146,8 @@ router.post('/me/update', passport.authenticate('jwt', {session: false}), async router.get('/etudiants', async (req, res) => { const users = await User.find(); + res.header("Access-Control-Allow-Origin", "*"); + res.header("Access-Control-Allow-Headers", "X-Requested-With"); return res.status(200).json(users); });