fastify
Version:
Fast and low overhead web framework, for Node.js
33 lines (28 loc) • 452 B
JavaScript
const fastify = require('../fastify')({
logger: false
})
const schema = {
schema: {
response: {
200: {
type: 'object',
properties: {
hello: {
type: 'string'
}
}
}
}
}
}
fastify
.get('/', schema, function (req, reply) {
reply
.send({ hello: 'world' })
})
fastify.listen({ port: 3000 }, (err, address) => {
if (err) {
throw err
}
})