Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/swagger: swagger 문서 #31

Closed
wants to merge 10 commits into from
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const client = require('prom-client');
const express = require('express');
const swaggerUi = require('swagger-ui-express');

const spec = require('./swagger/swagger.json');

const {
customNodeCpuUsage,
Expand Down Expand Up @@ -41,6 +44,8 @@ customNodeMemoryUsageBytes(register);
customNodeMemoryUsage(register);
customNodeDiskLatency(register);

app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(spec));

app.get('/metrics', async (req, res) => {
res.setHeader('Content-Type', register.contentType);
res.send(await register.metrics());
Expand Down
Loading