Skip to content

Commit b384d26

Browse files
fix: added a proper callback to express app initialization (nodejs#4843)
Co-authored-by: Aymen Naghmouchi <[email protected]>
1 parent 59b1371 commit b384d26

File tree

8 files changed

+30
-20
lines changed

8 files changed

+30
-20
lines changed

locale/en/docs/guides/nodejs-docker-webapp.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ app.get('/', (req, res) => {
6161
res.send('Hello World');
6262
});
6363

64-
app.listen(PORT, HOST);
65-
console.log(`Running on http://${HOST}:${PORT}`);
64+
app.listen(PORT, HOST, () => {
65+
console.log(`Running on http://${HOST}:${PORT}`);
66+
});
6667
```
6768

6869
In the next steps, we'll look at how you can run this app inside a Docker

locale/es/docs/guides/nodejs-docker-webapp.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ app.get('/', (req, res) => {
5050
res.send('Hello World');
5151
});
5252

53-
app.listen(PORT, HOST);
54-
console.log(`Running on http://${HOST}:${PORT}`);
53+
app.listen(PORT, HOST, () => {
54+
console.log(`Running on http://${HOST}:${PORT}`);
55+
});
5556
```
5657

5758
In the next steps, we'll look at how you can run this app inside a Docker container using the official Docker image. First, you'll need to build a Docker image of your app.

locale/fr/docs/guides/nodejs-docker-webapp.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ app.get('/', (req, res) => {
5050
res.send('Hello World');
5151
});
5252

53-
app.listen(PORT, HOST);
54-
console.log(`Running on http://${HOST}:${PORT}`);
53+
app.listen(PORT, HOST, () => {
54+
console.log(`Running on http://${HOST}:${PORT}`);
55+
});
5556
```
5657

5758
In the next steps, we'll look at how you can run this app inside a Docker container using the official Docker image. First, you'll need to build a Docker image of your app.

locale/ja/docs/guides/nodejs-docker-webapp.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ app.get('/', (req, res) => {
8383
res.send('Hello World');
8484
});
8585
86-
app.listen(PORT, HOST);
87-
console.log(`Running on http://${HOST}:${PORT}`);
86+
app.listen(PORT, HOST, () => {
87+
console.log(`Running on http://${HOST}:${PORT}`);
88+
});
8889
```
8990
9091
In the next steps, we'll look at how you can run this app inside a Docker
@@ -135,8 +136,9 @@ app.get('/', (req, res) => {
135136
res.send('Hello World');
136137
});
137138

138-
app.listen(PORT, HOST);
139-
console.log(`Running on http://${HOST}:${PORT}`);
139+
app.listen(PORT, HOST, () => {
140+
console.log(`Running on http://${HOST}:${PORT}`);
141+
});
140142
```
141143

142144
次のステップでは、公式の Docker イメージを使用して

locale/ko/docs/guides/nodejs-docker-webapp.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ app.get('/', (req, res) => {
103103
res.send('Hello World');
104104
});
105105
106-
app.listen(PORT, HOST);
107-
console.log(`Running on http://${HOST}:${PORT}`);
106+
app.listen(PORT, HOST, () => {
107+
console.log(`Running on http://${HOST}:${PORT}`);
108+
});
108109
```
109110
110111
In the next steps, we'll look at how you can run this app inside a Docker
@@ -132,8 +133,9 @@ app.get('/', (req, res) => {
132133
res.send('Hello World');
133134
});
134135

135-
app.listen(PORT, HOST);
136-
console.log(`Running on http://${HOST}:${PORT}`);
136+
app.listen(PORT, HOST, () => {
137+
console.log(`Running on http://${HOST}:${PORT}`);
138+
});
137139
```
138140

139141
다음 단계에서 공식 Docker 이미지를 사용해서 Docker 컨테이너 안에서 이 앱을 실행하는 방법을

locale/ro/docs/guides/nodejs-docker-webapp.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ app.get('/', (req, res) => {
5050
res.send('Hello World');
5151
});
5252

53-
app.listen(PORT, HOST);
54-
console.log(`Running on http://${HOST}:${PORT}`);
53+
app.listen(PORT, HOST, () => {
54+
console.log(`Running on http://${HOST}:${PORT}`);
55+
});
5556
```
5657

5758
In the next steps, we'll look at how you can run this app inside a Docker container using the official Docker image. First, you'll need to build a Docker image of your app.

locale/ru/docs/guides/nodejs-docker-webapp.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ app.get('/', (req, res) => {
6161
res.send('Hello World');
6262
});
6363

64-
app.listen(port, host);
65-
console.log(`running on http://${host}:${port}`);
64+
app.listen(PORT, HOST, () => {
65+
console.log(`Running on http://${HOST}:${PORT}`);
66+
});
6667
```
6768

6869
Далее мы рассмотрим, как можно запускать это приложение внутри Docker-контейнера,

locale/zh-cn/docs/guides/nodejs-docker-webapp.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ app.get('/', (req, res) => {
5050
res.send('Hello World');
5151
});
5252

53-
app.listen(PORT, HOST);
54-
console.log(`Running on http://${HOST}:${PORT}`);
53+
app.listen(PORT, HOST, () => {
54+
console.log(`Running on http://${HOST}:${PORT}`);
55+
});
5556
```
5657

5758
在稍后的步骤中我们将看一下借助使用官方的 Docker 镜像,你如何在 Docker 镜像中运行这个应用。首先,你需要一个构建一个应用程序的 Docker 应用。

0 commit comments

Comments
 (0)