Add 'routes/episodes.js'

This commit is contained in:
Muhammad Iqbal Rifai 2018-07-04 10:02:09 +02:00
parent 832f78b1af
commit d7f734e3e6
1 changed files with 23 additions and 0 deletions

23
routes/episodes.js Normal file
View File

@ -0,0 +1,23 @@
const express = require("express");
const router = express.Router();
//const router = require("express-promise-router")();
const EpisodesController = require("../controllers/episodes");
router
.route("/")
.get(EpisodesController.index)
.post(EpisodesController.newEpisode);
router
.route("/:slug")
.get(EpisodesController.getEpisode)
/* .put(EpisodesController.replaceEpisode)
.patch(EpisodesController.updateEpisode) */
.delete(EpisodesController.deleteEpisode);
router
.route("/:episodeId")
.put(EpisodesController.replaceEpisode)
.patch(EpisodesController.updateEpisode);
module.exports = router;