Skip to content

Commit 2016f61

Browse files
authored
サーバーの初級演習の課題の解答例をコピペで動くようにした (#771)
1 parent ff0d26d commit 2016f61

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/3-web-servers/05-server/index.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,17 @@ Express を用いて、`あなたは n 人目のお客様です。` とレスポ
257257

258258
<Answer title="訪問者カウンター">
259259

260-
```javascript
260+
```javascript title="main.mjs"
261+
import express from "express";
262+
const app = express();
263+
261264
let count = 0;
262265
app.get("/", (request, response) => {
263266
count += 1;
264267
response.send(`あなたは${count}人目のお客様です。`);
265268
});
269+
270+
app.listen(3000);
266271
```
267272

268273
<ViewSource url={import.meta.url} path="_samples/nth" />

0 commit comments

Comments
 (0)