Skip to content

Commit ad06eea

Browse files
committed
separate users[] -> str(as html) into another line
1 parent 25b4079 commit ad06eea

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,8 @@ const app = express();
219219
const names = ["田中", "鈴木", "佐藤"];
220220
app.get("/", (request, response) => {
221221
const index = fs.readFileSync("./index.html", "utf-8");
222-
const html = index.replace(
223-
"{users}",
224-
names.map((user) => `<li>${user}</li>`).join(""),
225-
);
222+
const usersAsHTML = names.map((user) => `<li>${user}</li>`).join("");
223+
const html = index.replace("{users}", usersAsHTML);
226224
response.send(html);
227225
});
228226

0 commit comments

Comments
 (0)