BlockController.js
/**
   * Web API POST endpoint to validate request with JSON response, url: "/requestValidation"
   */
Web API POST endpoint to validate request with JSON response, url: "/requestValidation"
Web API POST endpoint to validate request with JSON response url : " / requestValidation "
postRequestValidation() {
    this.app.post("/requestValidation", (req, res) => {
      try {
        let mempoolEntry = this.mempool.addRequestValidation(req);
        res.status(200).json({
          "walletAddress" : mempoolEntry.address,
          "requestTimeStamp" : mempoolEntry.requestTimeStamp,
          "message" : mempoolEntry.message,
          "validationWindow" : mempoolEntry.validationWindow
        });
      }
      catch(err) {
        console.log(`Bad request: ${err}`);
        res.status(400).send(`Bad request: ${err}`);
      }
      res.end();
    });
  }
postRequestValidation ( ) { this . app . post ( "/requestValidation" , ( req , res ) => { try { let mempoolEntry = this . mempool . addRequestValidation ( req ) ; res . status ( 200 ) . json ( { "walletAddress" : mempoolEntry . address , "requestTimeStamp" : mempoolEntry . requestTimeStamp , "message" : mempoolEntry . message , "validationWindow" : mempoolEntry . validationWindow } ) ; } catch ( err ) { console . log ( ` ${ err } ` ) ; res . status ( 400 ) . send ( ` ${ err } ` ) ; } res . end ( ) ; } ) ; }
Web API POST endpoint to validate request with JSON response, url: "/requestValidation"
Web API POST endpoint to validate request with JSON response url : " / requestValidation "