UNPKG

424 BJavaScriptView Raw
1// works on Node v14.13.0+
2import { fastify } from '../fastify.js'
3
4const app = fastify({
5 logger: false
6})
7
8const schema = {
9 schema: {
10 response: {
11 200: {
12 type: 'object',
13 properties: {
14 hello: {
15 type: 'string'
16 }
17 }
18 }
19 }
20 }
21}
22
23app.get('/', schema, async function (req, reply) {
24 return { hello: 'world' }
25})
26
27app.listen(3000).catch(console.error)