Last active
January 12, 2020 13:40
-
-
Save Palatnyi/fcd61572128492f422935cdc47a5f870 to your computer and use it in GitHub Desktop.
server.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, { 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