diff options
author | William Harrington <kb0iic@berzerkula.org> | 2019-04-17 22:57:14 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2019-04-17 22:57:14 -0500 |
commit | b82754fb96c1bfea63b2da2ed57390e785b4a017 (patch) | |
tree | e64635479103b18147b8ffcbe7ea2394c7ca9858 | |
parent | cd0bd0520360d1a4166e988010952dc2e064ac42 (diff) |
Add functionality to add members.
-rw-r--r-- | index.js | 4 | ||||
-rw-r--r-- | routes/api/members.js | 5 |
2 files changed, 9 insertions, 0 deletions
@@ -7,6 +7,10 @@ const app = express(); // Init middleware // app.use(logger); +// Body Parser Middleware +app.use(express.json()); +app.use(express.urlencoded({exnteded: false})); + // Set static directory app.use(express.static(path.join(__dirname, 'public'))); diff --git a/routes/api/members.js b/routes/api/members.js index 16989fb..7e3f6f8 100644 --- a/routes/api/members.js +++ b/routes/api/members.js @@ -18,4 +18,9 @@ router.get('/:id', (req, res) => { } }); +// Create Member +router.post('/', (req, res) => { + res.send(req.body); +}); + module.exports = router; |