aboutsummaryrefslogtreecommitdiff
path: root/server/controllers
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-07-11 13:32:43 +0200
committerMateja <mail@matejamaric.com>2021-07-11 13:32:43 +0200
commit3fbd440fe39a2677a12c234f06aaa1bae6a197a4 (patch)
treeb27e26d567a5e8106d597a84fd1d664e61a08cd8 /server/controllers
parent54677c68f50b7c105a1f6cc5e9593877781fc8d6 (diff)
downloadmevn-ecommerce-3fbd440fe39a2677a12c234f06aaa1bae6a197a4.tar.gz
mevn-ecommerce-3fbd440fe39a2677a12c234f06aaa1bae6a197a4.zip
Added Product routes, model and boilerplate controller.
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/example.js7
-rw-r--r--server/controllers/products.js23
2 files changed, 23 insertions, 7 deletions
diff --git a/server/controllers/example.js b/server/controllers/example.js
deleted file mode 100644
index 400bafc..0000000
--- a/server/controllers/example.js
+++ /dev/null
@@ -1,7 +0,0 @@
-module.exports = {
- index(req, res) {
- res.json({
- status: "success"
- });
- }
-};
diff --git a/server/controllers/products.js b/server/controllers/products.js
new file mode 100644
index 0000000..6265e27
--- /dev/null
+++ b/server/controllers/products.js
@@ -0,0 +1,23 @@
+module.exports = {
+
+ index(req, res) {
+ res.json({products: "index"});
+ },
+
+ show(req, res) {
+ res.json({products: "show"});
+ },
+
+ store(req, res) {
+ res.json({products: "store"});
+ },
+
+ update(req, res) {
+ res.json({products: "update"});
+ },
+
+ destroy(req, res) {
+ res.json({products: "destroy"});
+ },
+
+};