const { route } = require("express/lib/application");
const {authJwt} = require("../middlewares");
module.exports = app => {
    const routePathTemplates = require("../controllers/route-path-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 routes
    router.get("/", [authJwt.verifyToken],routePathTemplates.getAllRoutesTemplates);
    // Create a new route
    router.post("/", [authJwt.verifyToken], routePathTemplates.createRoutePathTemplate);
    // Update a route with id
    router.put("/:id", [authJwt.verifyToken], routePathTemplates.updateRouteTemplate);
    // Delete a route with id
    router.delete("/:id", [authJwt.verifyToken], routePathTemplates.deleteRouteTemplate);
    app.use('/api/route-templates', router);
 };