Skip to content

Instantly share code, notes, and snippets.

@mcollina
Created April 12, 2022 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcollina/06b6a1bb838b85824102d22b7c3570a2 to your computer and use it in GitHub Desktop.
Save mcollina/06b6a1bb838b85824102d22b7c3570a2 to your computer and use it in GitHub Desktop.
import Fastify from 'fastify'
const app = Fastify({ logger: true })
app.get('/', async (request, reply) => {
setImmediate(() => {
reply.send({ hello: 'world' })
})
// return reply is needed to tell Fastify we will call
// reply.send() in the future.
return reply
})
await app.listen({ port: 3000 })
@yaneony
Copy link

yaneony commented May 2, 2022

What about point-of-view, will it be:

app.get('/', async (request, reply) => {
  reply.view('tempalte')
  return reply
});

like this?

@mcollina
Copy link
Author

mcollina commented May 2, 2022

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment