Update routes & controllers

This commit is contained in:
Yûki VACHOT 2021-12-01 05:28:47 +01:00
parent 698fe87024
commit 46d1daa085
8 changed files with 105 additions and 64 deletions

View file

@ -2,20 +2,28 @@ const videos = require("../controllers/video.controller");
module.exports = app => {
let router = require("express").Router();
router.post("/video/search", videos.search);
// Search Videos
router.get("/video/search", videos.search);
router.post("/video/history", videos.history);
// Get Video with id of source
router.get("/video/:id", videos.get);
router.post("/video/create", videos.create);
// Create a new Video
router.post("/video/create/:id", videos.create);
// Retrieve all Videos
router.get("/video/findAll", videos.findAll);
// Find single Video with id
router.get("/video/findOne/:id", videos.findOne);
// Update Video with id
router.put("/video/update/:id", videos.update);
// Delete Video with id
router.delete("/video/delete/:id", videos.delete);
// Delete all Videos
router.delete("/video/deleteAll", videos.deleteAll);
app.use('/api', router);