UNPKG

461 BJavaScriptView Raw
1const fastify = require('../fastify')()
2
3const opts = {
4 schema: {
5 response: {
6 '2xx': {
7 type: 'object',
8 properties: {
9 hello: {
10 type: 'string'
11 }
12 }
13 }
14 }
15 }
16}
17fastify.register(require('./plugin'), opts, function (err) {
18 if (err) throw err
19})
20
21fastify.listen(3000, function (err) {
22 if (err) {
23 throw err
24 }
25 console.log(`server listening on ${fastify.server.address().port}`)
26})