diff --git a/package.json b/package.json index 7bc8ade..315b126 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,8 @@ "seed": "mysql --local-infile -u root < schema.sql" }, "dependencies": { + "body-parser": "^1.18.3", + "express": "^4.16.3", "moment": "^2.22.2" }, "devDependencies": { diff --git a/server/.gitkeep b/server/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/server/index.js b/server/index.js new file mode 100644 index 0000000..4a74360 --- /dev/null +++ b/server/index.js @@ -0,0 +1,20 @@ +const express = require('express'); +const bodyParser = require('body-parser'); + +const app = express(); + +app.use(express.static('../public')); + +app.use(bodyParser.urlencoded({ extended: false })); + +app.use(bodyParser.json()); + +app.get('/room/:roomid/bookings', (req, res) => { + res.send('test get successful'); +}); + +app.post('/room/:roomid/bookings', (req, res) => { + res.send('test post successful'); +}); + +app.listen(3003, () => console.log('Listening on port 3003'));