Closed xqq965 closed 11 months ago
It's a JSON file with your API specification in OpenAPI format. It describes your API. Like in one of the examples: https://github.com/slanatech/swagger-stats/blob/master/examples/authtest/petstore.json
It is optional, though - if you don't have API specification, you can skip passing it in parameters - swagger-stats will collect metrics based on routes in your app.
like this KOA demo : const swStats = require('swagger-stats'); const apiSpec = require('swagger.json'); const e2k = require('express-to-koa'); app.use(e2k(swStats.getMiddleware({ swaggerSpec:apiSpec })));