const {authJwt} = require("../middlewares");
module.exports = app => {
    const messageTokens = require("../controllers/message-token.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 messageTokens
    router.get("/",[authJwt.verifyToken], messageTokens.getAllMessageTokens);
    // Create a new messageToken
    router.post("/", [authJwt.verifyToken], messageTokens.createMessageToken);
    // Update an messageToken
    router.put("/:id",[authJwt.verifyToken], messageTokens.updateMessageToken );
    app.use('/api/message-tokens', router);
 };