gen-express-app
Version:
Alternative to express-generator, an easy-to-use tool for creating modern express applications.
23 lines (16 loc) • 349 B
JavaScript
export const PORT = normalizePort(process.env.PORT || '3000')
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}