Skip to content

Commit

Permalink
Dependencies cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sv2 committed Apr 3, 2021
1 parent 89af3d4 commit aa0f54d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ and swagger-stats will match API requests with API Operations defined in swagger
### Built-In API Telemetry

> **swagger-stats** provides built-in Telemetry UX, so you may enable **swagger-stats** in your app, and start monitoring immediately, with no infrastructure requirements.
> Navigate to `http://<your app host:port>/swagger-stats/ux`
> Navigate to `http://<your app host:port>/swagger-stats/`

![swagger-stats Built-In Telemetry](screenshots/swsux.gif?raw=true)
Expand Down Expand Up @@ -115,7 +115,11 @@ const fastify = require('fastify')({
logger: true
});

fastify.register(swStats.getFastifyPlugin, {swaggerSpec:apiSpec});
// Enable swagger-stats
fastify.register(require('fastify-express')).then(()=>{
fastify.register(swStats.getFastifyPlugin, {swaggerSpec:apiSpec});
});

```


Expand Down
5 changes: 4 additions & 1 deletion examples/fastify/fasifytest.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ let swsOptions = {
};

// Enable swagger-stats
fastify.register(swStats.getFastifyPlugin, swsOptions);
fastify.register(require('fastify-express')).then(()=>{
fastify.register(swStats.getFastifyPlugin, swsOptions);
});


// Run the server!
fastify.listen(3040, function (err, address) {
Expand Down
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@
"uuid": "^8.3.2"
},
"peerDependencies": {
"prom-client": ">= 10 <= 13"
"prom-client": ">= 10 <= 13",
"express": ">= 4",
"fastify": ">= 3",
"restify": ">= 8",
"@hapi/hapi": ">= 20"
},
"devDependencies": {
"@hapi/hapi": "^20.1.2",
Expand All @@ -115,6 +119,7 @@
"cuid": "^2.1.8",
"express": "^4.17.1",
"fastify": "^3.14.1",
"fastify-express": "^0.3.2",
"istanbul": "^0.4.5",
"mocha": "^8.3.2",
"ncp": "^2.0.0",
Expand Down

0 comments on commit aa0f54d

Please sign in to comment.