Skip to content

Instantly share code, notes, and snippets.

@ch8n
Created May 12, 2019 19:25
Show Gist options
  • Select an option

  • Save ch8n/6d6e80cdc4c85c46918e0c0e9c6e244a to your computer and use it in GitHub Desktop.

Select an option

Save ch8n/6d6e80cdc4c85c46918e0c0e9c6e244a to your computer and use it in GitHub Desktop.
simple typescript nodejs server
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