Benchmarking an API’s Response Time

In order to provide response time estimates for an API service, I used two tools, namely Postman (a third party application), and cURL. The latter was used because it gave a more accurate time estimate. Target API Server REST API server powered by Node.js and the Express Web Application Framework Runs on free public tier […]

Late Night Coding – Ternary if Operator

Midnight coding often results in weird/roundabout logic, such as the one expressed below. It is a snippet from a simple REST API server that uses Nodejs and the Express framework. (‘/dashboard’, function (req, res) { var reqBody = req.body if (reqBody.hasOwnProperty(‘transactionID’) && reqBody.hasOwnProperty(‘errorCode’)){ res.status(reqBody.errorCode).json(ErrorHandler(reqBody.transactionID, reqBody.errorCode)) }) function ErrorHandler (transactionID, errorCode) { if (errorCode == […]