diff --git a/backend/app 2.js b/backend/app 2.js deleted file mode 100644 index 6737984d833d8a2007d4af3d22f01d9c46d4e662..0000000000000000000000000000000000000000 --- a/backend/app 2.js +++ /dev/null @@ -1,30 +0,0 @@ -const express = require('express') -const bodyParser = require('body-parser'); -const app = express() -const port = 3001 - -let rdv = [{"idMagasin":1,"idClient":1,"date":"2019-01-01","heure":"12:00:00"}]; - -app.use(bodyParser.json()); - -app.get('/', (req, res) => { - res.send('Hello World!') -}) - -app.post('/prendre-rdv', (req, res) => { - console.log(req.body) - rdv.push({idMagasin: req.body.idMagasin, idClient: req.body.idClient, date: req.body.date, heure: req.body.heure}) - res.status(200).send('ok'); -}) - -app.get('/liste-rdv', (req, res) => { - res.send(rdv); -}) - -app.get('/liste-rdv/:id', (req, res) => { - res.send(rdv[req.params.id - 1]); -}) - -app.listen(port, () => { - console.log(`Example app listening on port ${port}`) -}) \ No newline at end of file diff --git a/backend/package 2.json b/backend/package 2.json deleted file mode 100644 index 238a2517a23b02568dd9d5061d79cd0a9d15d1ad..0000000000000000000000000000000000000000 --- a/backend/package 2.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "myapp", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "dependencies": { - "express": "^4.18.2" - } -} diff --git a/backend/package.json b/backend/package.json index 238a2517a23b02568dd9d5061d79cd0a9d15d1ad..e52b6818e207177fc58b5eff6ec5a8ab559f20ce 100644 --- a/backend/package.json +++ b/backend/package.json @@ -4,7 +4,7 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "start": "node app.js" }, "author": "", "license": "ISC", diff --git a/backend/app.js b/backend/src/app.js similarity index 100% rename from backend/app.js rename to backend/src/app.js diff --git a/backend/test 2.json b/backend/test 2.json deleted file mode 100644 index 239b9b6343a0c00310a21b73063c6b9cd1fd961f..0000000000000000000000000000000000000000 --- a/backend/test 2.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "idMagasin": 1, - "idClient": 1, - "date": "2019-01-01", - "heure": "12:00:00" -} \ No newline at end of file diff --git a/backend/test.json b/backend/test.json deleted file mode 100644 index 239b9b6343a0c00310a21b73063c6b9cd1fd961f..0000000000000000000000000000000000000000 --- a/backend/test.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "idMagasin": 1, - "idClient": 1, - "date": "2019-01-01", - "heure": "12:00:00" -} \ No newline at end of file