Skip to content

Commit

Permalink
Merge pull request #2 from DevDivas/serversetup
Browse files Browse the repository at this point in the history
Set up express server/its dependencies
  • Loading branch information
allisonc07 authored Jul 21, 2018
2 parents 3c4fba5 + 90e7de7 commit 62b8059
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Empty file removed server/.gitkeep
Empty file.
20 changes: 20 additions & 0 deletions server/index.js
Original file line number Diff line number Diff line change
@@ -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'));

0 comments on commit 62b8059

Please sign in to comment.