UNPKG

@fastify/swagger

Version:

Serve Swagger/OpenAPI documentation for Fastify, supporting dynamic generation

18 lines (14 loc) 362 B
'use strict' 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.yaml' }, exposeRoute: true }) fastify.listen({ port: 3000 }, (err) => { if (err) throw err })