Toggle navigation
Toggle navigation
This project
Loading...
Sign in
seungmin lee
/
OSS2020-2_Screensaver
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이민호
2020-12-09 19:30:42 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
59fd5e51bde44302edf4f04057ebedf27214a464
59fd5e51
1 parent
66f697ae
change port
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
screensaver/bin/www
screensaver/bin/www
View file @
59fd5e5
...
...
@@ -4,16 +4,16 @@
* Module dependencies.
*/
var
app
=
require
(
'../app'
);
var
debug
=
require
(
'debug'
)(
'screensaver:server'
);
var
http
=
require
(
'http'
);
var
app
=
require
(
"../app"
);
var
debug
=
require
(
"debug"
)(
"screensaver:server"
);
var
http
=
require
(
"http"
);
/**
* Get port from environment and store in Express.
*/
var
port
=
normalizePort
(
process
.
env
.
PORT
||
'3000'
);
app
.
set
(
'port'
,
port
);
var
port
=
normalizePort
(
process
.
env
.
PORT
||
"8080"
);
app
.
set
(
"port"
,
port
);
/**
* Create HTTP server.
...
...
@@ -26,8 +26,8 @@ var server = http.createServer(app);
*/
server
.
listen
(
port
);
server
.
on
(
'error'
,
onError
);
server
.
on
(
'listening'
,
onListening
);
server
.
on
(
"error"
,
onError
);
server
.
on
(
"listening"
,
onListening
);
/**
* Normalize a port into a number, string, or false.
...
...
@@ -54,22 +54,20 @@ function normalizePort(val) {
*/
function
onError
(
error
)
{
if
(
error
.
syscall
!==
'listen'
)
{
if
(
error
.
syscall
!==
"listen"
)
{
throw
error
;
}
var
bind
=
typeof
port
===
'string'
?
'Pipe '
+
port
:
'Port '
+
port
;
var
bind
=
typeof
port
===
"string"
?
"Pipe "
+
port
:
"Port "
+
port
;
// handle specific listen errors with friendly messages
switch
(
error
.
code
)
{
case
'EACCES'
:
console
.
error
(
bind
+
' requires elevated privileges'
);
case
"EACCES"
:
console
.
error
(
bind
+
" requires elevated privileges"
);
process
.
exit
(
1
);
break
;
case
'EADDRINUSE'
:
console
.
error
(
bind
+
' is already in use'
);
case
"EADDRINUSE"
:
console
.
error
(
bind
+
" is already in use"
);
process
.
exit
(
1
);
break
;
default
:
...
...
@@ -83,8 +81,6 @@ function onError(error) {
function
onListening
()
{
var
addr
=
server
.
address
();
var
bind
=
typeof
addr
===
'string'
?
'pipe '
+
addr
:
'port '
+
addr
.
port
;
debug
(
'Listening on '
+
bind
);
var
bind
=
typeof
addr
===
"string"
?
"pipe "
+
addr
:
"port "
+
addr
.
port
;
debug
(
"Listening on "
+
bind
);
}
...
...
Please
register
or
login
to post a comment