Created
January 19, 2019 06:56
-
-
Save PavelPolyakov/0290050546c26dfbd8d4a6d4a30ede4d 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: "/status", | |
logLevel: "warn", | |
method: ["GET", "HEAD"], | |
handler: async (request, reply) => { | |
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