"use strict";

import * as http from "http";
import * as express from "express";

const app = express();

app.use(express.static("public"));

app.get("/", (req, res) => {
	res.send("Hello Boss!");
});

const server = app.listen(8888, () =>{
	const port = server.address().port;
	
	console.log(`Boss is listening at port: ${port}`);
	
});
"use strict";
import * as express from "express";

const app = express();
app.use(express.static("public"));

const server = app.listen(process.env.PORT || 1337, () =>{
	console.log(`Boss is listening at port: ${server.address().port}`);
});
Read port number from environment variable
Read port number from environment variable

Azure passes in the port number through the PORT environment variable. This is the port number the Azure load balancer forwards traffic to. I.e.

Browser -------> LB (port 80) ---------> Node.js (PORT EV)

If the EV is not specified we default to 1337.

See https://azure.microsoft.com/en-us/documentation/articles/web-sites-nodejs-develop-deploy-mac/
