Skip to content

Instantly share code, notes, and snippets.

@Palatnyi
Last active January 12, 2020 13:40
Show Gist options
  • Save Palatnyi/fcd61572128492f422935cdc47a5f870 to your computer and use it in GitHub Desktop.
Save Palatnyi/fcd61572128492f422935cdc47a5f870 to your computer and use it in GitHub Desktop.
server.ts
import express, { Application, RequestHandler, Request, Response } from "express";
const app: Application = express();
const alwaysRespondWithHelloWorld: RequestHandler = (req: Request, res: Response) => {
res.send('hello world');
};
app.use(alwaysRespondWithHelloWorld)
app.listen(3000, () => {
console.log(`app is listening on port ${3000}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment