Skip to content

Commit

Permalink
[added] route get prods
Browse files Browse the repository at this point in the history
  • Loading branch information
luarrekcah committed Apr 8, 2023
1 parent 4d3679e commit 4d2434d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/routes/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
const { getAllItems } = require("../database");

const express = require("express"),
router = express.Router();

router.get("/", (req, res, next) => {
res.sendStatus(200);
res.sendStatus(200);
});

router.get("/getproducts", async (req, res, next) => {
const allProds = await getAllItems({
path: "products"
});

res.json(allProds);
});

module.exports = router;

0 comments on commit 4d2434d

Please sign in to comment.