api-response-times

Writes to a file the time in ms your server takes from approximately the time your API is called to when the response is returned.

Usage no npm install needed!

<script type="module">
  import apiResponseTimes from 'https://cdn.skypack.dev/api-response-times';
</script>

README

api-response-times

Records approximate api respoponse times to a file

Example

See the test folder for a complete example. Basically just require the middleware and instantiate it with app.use where all your middlewares are. Make sure you do this before your your routes.


var app = express();
var fileName = "./api_response_test.txt";
var urlStr = "/api/"
var responseTimes = require("api-response-times")(fileName, urlStr);
... fast forward to your middlwares
app.use(responseTimes);
...