Chapter 11: update example microservice

This commit is contained in:
Beth Griggs
2020-11-15 01:11:41 +00:00
parent 791aac76d7
commit cb0e52e541
11 changed files with 146 additions and 9 deletions
@@ -23,4 +23,5 @@ If you need to share functionality between services, place that
functionality into the `plugins` folder, and share it via
[decorators](https://www.fastify.io/docs/latest/Decorators/).
If you have a bit confused about using `async/await` write services, you would better take a look at [Promise resolution](https://github.com/fastify/fastify/blob/master/docs/Routes.md#promise-resolution) for more details.
If you're a bit confused about using `async/await` to write services, you would
better take a look at [Promise resolution](https://www.fastify.io/docs/latest/Routes/#promise-resolution) for more details.
@@ -0,0 +1,7 @@
'use strict'
module.exports = async function (fastify, opts) {
fastify.get('/', async function (request, reply) {
return 'this is an example'
})
}
@@ -0,0 +1,7 @@
'use strict'
module.exports = async function (fastify, opts) {
fastify.get('/', async function (request, reply) {
return { root: true }
})
}