const {authJwt} = require("../middlewares");
module.exports = app => {
    const dailyRoutesTemplates = require("../controllers/daily-routes-template.controller.js");
    app.use((req, res, next) => {
      res.header(
        "Access-Control-Allow-Headers",
        "x-access-token, Origin, Content-Type, Accept"
      );
      next();
    });
    var router = require("express").Router();
    // Retrieve all daily routes templates
    router.get("/", [authJwt.verifyToken], dailyRoutesTemplates.getAllDailyRoutesTemplates);
    // Get one daily routes template by id
    router.get("/:id", [authJwt.verifyToken], dailyRoutesTemplates.getDailyRoutesTemplate);
    // Create a new daily routes template
    router.post("/", [authJwt.verifyToken], dailyRoutesTemplates.createDailyRoutesTemplate);
    // Update a daily routes template with id
    router.put("/:id", [authJwt.verifyToken], dailyRoutesTemplates.updateDailyRoutesTemplate);
    // Delete a daily routes template with id
    router.delete("/:id", [authJwt.verifyToken], dailyRoutesTemplates.deleteDailyRoutesTemplate);
    app.use('/api/daily-routes-templates', router);
};

