1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-02 20:15:25 +02:00

Main elements created (#4)

This commit is contained in:
Peter Savchenko 2018-09-18 13:10:44 +03:00 committed by GitHub
parent 248558a11f
commit 4326cb22ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 172 additions and 13 deletions

View file

@ -22,7 +22,6 @@ const server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
@ -30,7 +29,6 @@ server.on('listening', onListening);
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
const port = parseInt(val, 10);
@ -50,7 +48,6 @@ function normalizePort(val) {
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
@ -78,7 +75,6 @@ function onError(error) {
/**
* Event listener for HTTP server "listening" event.
*/
function onListening() {
const addr = server.address();
const bind = typeof addr === 'string'