Last active
July 17, 2017 17:40
-
-
Save delvedor/19239b919232820af2e99bbdbf24066b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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