Skip to content

Commit 8494994

Browse files
committed
エンコーディング追加
1 parent 9e2945c commit 8494994

File tree

3 files changed

+3
-3
lines changed
  • docs/3-web-servers

3 files changed

+3
-3
lines changed

docs/3-web-servers/05-form/_samples/book-search-system/main.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ app.get("/send", (request, response) => {
1717
const selectedBooks = books.filter(
1818
(book) => book.author === request.query.author,
1919
);
20-
const html_template = fs.readFileSync("./send.html");
20+
const html_template = fs.readFileSync("./send.html", "utf-8");
2121
const html = html_template.replace(
2222
"{books}",
2323
selectedBooks.map((book) => `<li>${book.title}</li>`).join(""),

docs/3-web-servers/06-get-post/_samples/forum/main.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const messages = [];
88
app.use(express.urlencoded({ extended: true }));
99

1010
app.get("/", (request, response) => {
11-
const template = fs.readFileSync("index.html");
11+
const template = fs.readFileSync("index.html", "utf-8");
1212
const html = template.replace(
1313
"{messages}",
1414
messages.map((msg) => `<li>${msg}</li>`).join(""),

docs/3-web-servers/07-database/_samples/forum/main.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ app.get("/", async (request, response) => {
1212
const messages = await (
1313
await client.forum.findMany()
1414
).map((data) => data.message);
15-
const index = fs.readFileSync("index.html");
15+
const index = fs.readFileSync("index.html", "utf-8");
1616
const html = index.replace(
1717
"{messages}",
1818
messages.map((msg) => `<li>${msg}</li>`).join(""),

0 commit comments

Comments
 (0)