Created
January 19, 2019 12:49
-
-
Save PavelPolyakov/9c35760a115667d55e5d326d8ef5d0b5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import * as fp from "fastify-plugin"; | |
export default fp(async (server, opts, next) => { | |
server.route({ | |
url: "/error-thrower", | |
method: ["GET"], | |
handler: async (request, reply) => { | |
throw new Error("Oh no, something bad happened, try to debug me"); | |
return reply.send({ date: new Date(), works: true }); | |
} | |
}); | |
next(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
refers to https://medium.com/car2godevs/fastify-with-typescript-production-ready-integration-2303318ecd9e