Created
May 12, 2019 19:25
-
-
Save ch8n/6d6e80cdc4c85c46918e0c0e9c6e244a to your computer and use it in GitHub Desktop.
simple typescript nodejs server
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'; | |
| const app = express() | |
| const port : string|number= process.env.PORT || 5000; | |
| app.use("*",(req, res) =>{res.send("<h1>Welcome to your server!</h1>")}) | |
| //create a server object: | |
| app.listen(port,() => console.log(`hosting @${port}`)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment