Skip to content

Commit facdc6c

Browse files
change backend port
1 parent 6194d9c commit facdc6c

File tree

1 file changed

+42
-42
lines changed
  • packages/backend/express/bin

1 file changed

+42
-42
lines changed

packages/backend/express/bin/www

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,84 +4,84 @@
44
* Module dependencies.
55
*/
66

7-
const app = require('../app')
8-
const debug = require('debug')('express:server')
9-
const http = require('http')
7+
const app = require('../app');
8+
const debug = require('debug')('express:server');
9+
const http = require('http');
1010

1111
/**
1212
* Get port from environment and store in Express.
1313
*/
1414

15-
const port = normalizePort(process.env.PORT || '3000')
16-
app.set('port', port)
17-
console.log(`Your express app is running on http://localhost:${port}`)
15+
const port = normalizePort(process.env.PORT || '3001');
16+
app.set('port', port);
17+
console.log(`Your express app is running on http://localhost:${port}`);
1818

1919
/**
2020
* Create HTTP server.
2121
*/
2222

23-
const server = http.createServer(app)
23+
const server = http.createServer(app);
2424

2525
/**
2626
* Listen on provided port, on all network interfaces.
2727
*/
2828

29-
server.listen(port)
30-
server.on('error', onError)
31-
server.on('listening', onListening)
29+
server.listen(port);
30+
server.on('error', onError);
31+
server.on('listening', onListening);
3232

3333
/**
3434
* Normalize a port into a number, string, or false.
3535
*/
3636

3737
function normalizePort(val) {
38-
const port = parseInt(val, 10)
38+
const port = parseInt(val, 10);
3939

40-
if (isNaN(port)) {
41-
// named pipe
42-
return val
43-
}
40+
if (isNaN(port)) {
41+
// named pipe
42+
return val;
43+
}
4444

45-
if (port >= 0) {
46-
// port number
47-
return port
48-
}
45+
if (port >= 0) {
46+
// port number
47+
return port;
48+
}
4949

50-
return false
50+
return false;
5151
}
5252

5353
/**
5454
* Event listener for HTTP server "error" event.
5555
*/
5656

5757
function onError(error) {
58-
if (error.syscall !== 'listen') {
59-
throw error
60-
}
61-
62-
const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port
63-
64-
// handle specific listen errors with friendly messages
65-
switch (error.code) {
66-
case 'EACCES':
67-
console.error(bind + ' requires elevated privileges')
68-
process.exit(1)
69-
break
70-
case 'EADDRINUSE':
71-
console.error(bind + ' is already in use')
72-
process.exit(1)
73-
break
74-
default:
75-
throw error
76-
}
58+
if (error.syscall !== 'listen') {
59+
throw error;
60+
}
61+
62+
const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;
63+
64+
// handle specific listen errors with friendly messages
65+
switch (error.code) {
66+
case 'EACCES':
67+
console.error(bind + ' requires elevated privileges');
68+
process.exit(1);
69+
break;
70+
case 'EADDRINUSE':
71+
console.error(bind + ' is already in use');
72+
process.exit(1);
73+
break;
74+
default:
75+
throw error;
76+
}
7777
}
7878

7979
/**
8080
* Event listener for HTTP server "listening" event.
8181
*/
8282

8383
function onListening() {
84-
const addr = server.address()
85-
const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port
86-
debug('Listening on ' + bind)
84+
const addr = server.address();
85+
const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;
86+
debug('Listening on ' + bind);
8787
}

0 commit comments

Comments
 (0)