Skip to content

Commit 39c65a3

Browse files
committed
Remove wordy comments
1 parent 8627f8c commit 39c65a3

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

bin/www.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/**
2-
* Module dependencies.
3-
*/
4-
51
import * as program from "commander";
62
import * as debugModule from "debug";
73
import * as http from "http";
@@ -15,24 +11,11 @@ main().catch(console.error);
1511

1612
async function main() {
1713
const app = await createApp();
18-
19-
/**
20-
* Get port from environment and store in Express.
21-
*/
22-
2314
const port = normalizePort(program.port);
2415
app.set("port", port);
2516

26-
/**
27-
* Create HTTP server.
28-
*/
29-
3017
const server = http.createServer(app);
3118

32-
/**
33-
* Listen on provided port, on all network interfaces.
34-
*/
35-
3619
server.listen(port);
3720
server.on("error", onError(port));
3821
server.on("listening", onListening(server));
@@ -58,30 +41,20 @@ async function main() {
5841
});
5942
}
6043

61-
/**
62-
* Normalize a port into a number, string, or false.
63-
*/
64-
6544
function normalizePort(val: string) {
6645
const parsedPort = parseInt(val, 10);
6746

6847
if (isNaN(parsedPort)) {
69-
// named pipe
7048
return val;
7149
}
7250

7351
if (parsedPort >= 0) {
74-
// port number
7552
return parsedPort;
7653
}
7754

7855
return false;
7956
}
8057

81-
/**
82-
* Event listener for HTTP server "error" event.
83-
*/
84-
8558
function onError(port: any): (error: any) => void {
8659
return (error: any) => {
8760
if (error.syscall !== "listen") {
@@ -90,7 +63,6 @@ function onError(port: any): (error: any) => void {
9063

9164
const bind = typeof port === "string" ? "Pipe " + port : "Port " + port;
9265

93-
// handle specific listen errors with friendly messages
9466
switch (error.code) {
9567
case "EACCES":
9668
console.error(bind + " requires elevated privileges");
@@ -106,10 +78,6 @@ function onError(port: any): (error: any) => void {
10678
};
10779
}
10880

109-
/**
110-
* Event listener for HTTP server "listening" event.
111-
*/
112-
11381
function onListening(server: any): () => void {
11482
return () => {
11583
const addr = server.address();

0 commit comments

Comments
 (0)