Created
September 13, 2020 14:52
-
-
Save kingsley-einstein/3bc85753708e0387e577d56f549d16d2 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 express from "express"; | |
import debug from "debug"; | |
const app: express.Application = express(); | |
const log = debug("logging"); | |
app.use(express.json()); | |
app.use(express.urlencoded({ | |
extended: false | |
})); | |
app.use((req, res, next) => { | |
log(`${req.path} ++++++++ ${res.statusCode}`); | |
next(); | |
}); | |
app.get("/", (req, res) => { | |
res.json({ | |
path: req.path, | |
message: "Welcome online folks." | |
}); | |
}); | |
app.listen(4000, () => log("Server running on 4000")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment