aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2019-04-18 01:05:11 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2019-04-18 01:05:11 -0500
commit8438802ce05192f0c2b71795583622893c5f0d94 (patch)
treef428a66d1c93a8e182f4899e876d3ddb831e7122
parentdd2642cf9b012e4006dd14eafbaf85a4f62c110d (diff)
Add a visit api button for redirect to view json rather than after form submission.HEADmaster
-rw-r--r--routes/api/members.js4
-rw-r--r--views/index.handlebars2
2 files changed, 4 insertions, 2 deletions
diff --git a/routes/api/members.js b/routes/api/members.js
index 36b66aa..df5195f 100644
--- a/routes/api/members.js
+++ b/routes/api/members.js
@@ -33,8 +33,8 @@ router.post('/', (req, res) => {
}
members.push(newMember);
- //res.json(members);
- res.redirect('/nodejs');
+ res.json(members);
+ //res.redirect('/nodejs');
});
// Updat Member
diff --git a/views/index.handlebars b/views/index.handlebars
index d31363a..26f79ff 100644
--- a/views/index.handlebars
+++ b/views/index.handlebars
@@ -17,3 +17,5 @@
<li class="list-group-item">{{this.name}}: {{this.email}}</li>
{{/each}}
</ul>
+
+<a href="/nodejs/api/members" class="btn btn-light mt-4">Visit API</a>