Skip to content

Instantly share code, notes, and snippets.

@delvedor
Last active July 17, 2017 17:40
Show Gist options
  • Save delvedor/19239b919232820af2e99bbdbf24066b to your computer and use it in GitHub Desktop.
Save delvedor/19239b919232820af2e99bbdbf24066b to your computer and use it in GitHub Desktop.
fastify.decorate('genericPage', (req, reply) => {
reply.code(404).type('text/html').send(`
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<p>Not found :(</p>
</body>
</html>
`)
})
fastify.get('/', (req, reply) => {
fastify.genericPage(req, reply)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment