aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2019-04-17 22:57:14 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2019-04-17 22:57:14 -0500
commitb82754fb96c1bfea63b2da2ed57390e785b4a017 (patch)
treee64635479103b18147b8ffcbe7ea2394c7ca9858
parentcd0bd0520360d1a4166e988010952dc2e064ac42 (diff)
Add functionality to add members.
-rw-r--r--index.js4
-rw-r--r--routes/api/members.js5
2 files changed, 9 insertions, 0 deletions
diff --git a/index.js b/index.js
index 72dcfbe..d03a480 100644
--- a/index.js
+++ b/index.js
@@ -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;