Skip to content

Instantly share code, notes, and snippets.

@vassalloandrea
Created January 9, 2021 08:29
Show Gist options
  • Save vassalloandrea/c8f61345362f03248ebcc83ec6d0646e to your computer and use it in GitHub Desktop.
Save vassalloandrea/c8f61345362f03248ebcc83ec6d0646e to your computer and use it in GitHub Desktop.
Medium Morgan Winston Example - index TS
import express from "express";
import Logger from "./lib/logger";
const app = express();
const PORT = 3000;
app.get("/logger", (_, res) => {
Logger.error("This is an error log");
Logger.warn("This is a warn log");
Logger.info("This is a info log");
Logger.http("This is a http log");
Logger.debug("This is a debug log");
res.send("Hello world");
});
app.listen(PORT, () => {
Logger.debug(`Server is up and running @ http://localhost:${PORT}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment