UNPKG

@fastify/swagger-ui

Version:
22 lines (16 loc) 486 B
'use strict' const Fastify = require('fastify') ; (async () => { const fastify = Fastify({ logger: true }) await fastify.register(require('@fastify/swagger'), { mode: 'static', specification: { path: './examples/example-static-specification.json' } }) await fastify.register(require('../index')) fastify.listen({ port: 3000 }, (err, addr) => { if (err) throw err fastify.log.info(`Visit the documentation at ${addr}/documentation/`) }) })()