const { route } = require("express/lib/application");
module.exports = app => {
    const signatureRequest = require("../controllers/signature-request.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 signature requests
    router.get("/",signatureRequest.getAllSignatureRequests);
    // Get one signature request by id
    router.get("/:id", signatureRequest.getSignatureRequest);
    // Create a new signature request
    router.post("/", signatureRequest.createNewSignatureRequest);
    // Update a signature request with id
    router.put("/:id", signatureRequest.updateSignatureRequest);
    // Delete a signature request with id
    router.delete("/:id", signatureRequest.deleteSignatureRequest);
    app.use('/api/signature-requests', router);
 };