Skip to content

Instantly share code, notes, and snippets.

@kingsley-einstein
Created September 13, 2020 14:52
Show Gist options
  • Save kingsley-einstein/3bc85753708e0387e577d56f549d16d2 to your computer and use it in GitHub Desktop.
Save kingsley-einstein/3bc85753708e0387e577d56f549d16d2 to your computer and use it in GitHub Desktop.
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