Skip to content

Commit

Permalink
サーバーの初級演習の課題の解答例をコピペで動くようにした (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
aster-void authored May 16, 2024
1 parent ff0d26d commit 2016f61
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/3-web-servers/05-server/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,17 @@ Express を用いて、`あなたは n 人目のお客様です。` とレスポ

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

```javascript
```javascript title="main.mjs"
import express from "express";
const app = express();

let count = 0;
app.get("/", (request, response) => {
count += 1;
response.send(`あなたは${count}人目のお客様です。`);
});

app.listen(3000);
```

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

0 comments on commit 2016f61

Please sign in to comment.