const {authJwt} = require("../middlewares");
module.exports = app => {
    const resource = require("../controllers/resource.controller.js");
    var router = require("express").Router();
    // Retrieve all resources
    router.get("/", [authJwt.verifyToken], resource.getAllResources);
    // Create a new resource
    router.post("/", [authJwt.verifyToken], resource.createResource);
    router.get('/:id', [authJwt.verifyToken], resource.getResource);
    router.put('/:id', [authJwt.verifyToken], resource.updateResource);
    router.put('/:id/disable', [authJwt.verifyToken], resource.disableResource);
    router.delete('/:id', [authJwt.verifyToken], resource.deleteResource)
    app.use('/api/resources', router);
 };