Files
Node.js-14-Cookbook/Chapter06/fastify-generated-app/services/example/index.js
T

18 lines
388 B
JavaScript

'use strict'
module.exports = function (fastify, opts, next) {
fastify.get('/example', function (request, reply) {
reply.send('this is an example')
})
next()
}
// If you prefer async/await, use the following
//
// module.exports = async function (fastify, opts) {
// fastify.get('/example', async function (request, reply) {
// return 'this is an example'
// })
// }