diff --git a/Example-1/routes/tutorial.routes.js b/Example-1/routes/tutorial.routes.js new file mode 100644 index 0000000..955d9a2 --- /dev/null +++ b/Example-1/routes/tutorial.routes.js @@ -0,0 +1,28 @@ +module.exports = app => { + const tutorials = require("../controllers/tutorial.controller.js"); + + var router = require("express").Router(); + + // Create a new Tutorial + router.post("/", tutorials.create); + + // Retrieve all Tutorials + router.get("/", tutorials.findAll); + + // Retrieve all published Tutorials + router.get("/published", tutorials.findAllPublished); + + // Retrieve a single Tutorial with id + router.get("/:id", tutorials.findOne); + + // Update a Tutorial with id + router.put("/:id", tutorials.update); + + // Delete a Tutorial with id + router.delete("/:id", tutorials.delete); + + // Delete all Tutorials + router.delete("/", tutorials.deleteAll); + + app.use('/api/tutorials', router); +}; \ No newline at end of file