const {authJwt} = require("../middleware"); const controller = require("../controllers/player.controller"); module.exports = function(app) { app.use(function (req, res, next) { res.header( "Access-Control-Allow-Headers", "x-access-token, Origin, Content-Type, Accept" ); next(); }); app.post( "/api/players", [authJwt.verifyToken, authJwt.isCoachOrAdmin], controller.insert); app.get( "/api/players", [authJwt.verifyToken, authJwt.isCoachOrAdmin], controller.findAll); app.get( "/api/players/:id", [authJwt.verifyToken, authJwt.isCoachOrAdmin], controller.findOne); };