Update
This commit is contained in:
parent
4dfd8cd516
commit
5a64568824
22 changed files with 702 additions and 194 deletions
28
backend/app/routes/tutorial.routes.js
Normal file
28
backend/app/routes/tutorial.routes.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
module.exports = app => {
|
||||
const tutorials = require("../controllers/tutorial.controller.js");
|
||||
|
||||
let 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);
|
||||
|
||||
// Create a new Tutorial
|
||||
router.delete("/", tutorials.deleteAll);
|
||||
|
||||
app.use('/api/tutorials', router);
|
||||
};
|
||||
Reference in a new issue