Created
January 9, 2021 08:29
-
-
Save vassalloandrea/c8f61345362f03248ebcc83ec6d0646e to your computer and use it in GitHub Desktop.
Medium Morgan Winston Example - index TS
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
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