1 |
|
2 |
|
3 | const fastify = require('../fastify')({
|
4 | logger: false
|
5 | })
|
6 |
|
7 | const Readable = require('node:stream').Readable
|
8 |
|
9 | fastify
|
10 | .get('/', function (req, reply) {
|
11 | const stream = Readable.from(['hello world'])
|
12 | reply.send(stream)
|
13 | })
|
14 |
|
15 | fastify.listen({ port: 3000 }, (err, address) => {
|
16 | if (err) {
|
17 | throw err
|
18 | }
|
19 | fastify.log.info(`server listening on ${address}`)
|
20 | })
|