@fastify/swagger
Version:
Serve Swagger/OpenAPI documentation for Fastify, supporting dynamic generation
18 lines (14 loc) • 362 B
JavaScript
const fastify = require('fastify')({ logger: true })
// const swagger = require('@fastify/swagger')
const swagger = require('..')
fastify.register(swagger, {
mode: 'static',
specification: {
path: './examples/example-static-specification.json'
},
exposeRoute: true
})
fastify.listen({ port: 3000 }, (err) => {
if (err) throw err
})