Skip to content

Instantly share code, notes, and snippets.

@PavelPolyakov
Created January 19, 2019 06:55
Show Gist options
  • Save PavelPolyakov/53df2fe2410ccb52aabe9c2ce22af07f to your computer and use it in GitHub Desktop.
Save PavelPolyakov/53df2fe2410ccb52aabe9c2ce22af07f to your computer and use it in GitHub Desktop.
import * as fastify from "fastify";
import * as fastifyBlipp from "fastify-blipp";
import { Server, IncomingMessage, ServerResponse } from "http";
import statusRoutes from "./modules/routes/status";
const server: fastify.FastifyInstance<
Server,
IncomingMessage,
ServerResponse
> = fastify();
server.register(fastifyBlipp);
server.register(statusRoutes);
const start = async () => {
try {
await server.listen(3000, "0.0.0.0");
server.blipp();
} catch (err) {
console.log(err);
server.log.error(err);
process.exit(1);
}
};
process.on("uncaughtException", error => {
console.error(error);
});
process.on("unhandledRejection", error => {
console.error(error);
});
start();
@PavelPolyakov
Copy link
Author

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