diff --git a/haikus.json b/haikus.json index f8f8240..bdff1c8 100644 --- a/haikus.json +++ b/haikus.json @@ -1,22 +1,22 @@ [ { - "text": "rain in seattle,\ndon't forget an umbrella,\nor it will be gloom", + "text": "西雅圖降雨,\n別忘帶把雨傘去,\n否則心情灰。", "image": "puddle_jumper_octodex.jpg" }, { - "text": "my tunes on repeat,\nit's time for me to dj,\nhave you heard this one?", + "text": "我的歌重播,\n現在輪到我DJ,\n你聽過這首?", "image": "vinyltocat.jpeg" }, { - "text": "snow is still falling,\nis it time for après yet?\nlet's do one more run", + "text": "雪花仍飄落,\n該是滑雪後放鬆?\n再滑一趟吧。", "image": "snowtocat_final.jpg" }, { - "text": "beep boop bop beep boop,\ni am robot octocat,\ni think there's a bug", + "text": "嗶嗶波波嗶,\n我是機器章魚貓,\n我想有個錯。", "image": "Robotocat.jpeg" }, { - "text": "same plot as before,\nso why is it still awesome?\ni think it's the hat", + "text": "情節如從前,\n為何依然很精彩?\n我想是帽子。", "image": "linktocat.jpg" } ] diff --git a/index.js b/index.js index e966dd2..b12dcc7 100644 --- a/index.js +++ b/index.js @@ -20,20 +20,20 @@ app.get("/healthz", (req, res) => { }); app.use((err, req, res, next) => { - console.error("Unhandled error:", err); + console.error("未處理的錯誤:", err); if (res.headersSent) { return next(err); } return res.status(500).json({ - error: "internal_server_error", + error: "內部伺服器錯誤", }); }); if (require.main === module) { app.listen(port, () => { - console.log(`Server is running on port ${port}`); + console.log(`伺服器正在連接埠 ${port} 上運行`); }); } diff --git a/test/app.test.js b/test/app.test.js index 42864df..a767e15 100644 --- a/test/app.test.js +++ b/test/app.test.js @@ -9,7 +9,7 @@ test("GET / returns html page", async () => { assert.equal(response.status, 200); assert.match(response.headers["content-type"], /text\/html/); - assert.match(response.text, /Haikus for Mona/); + assert.match(response.text, /Mona 的俳句/); }); test("GET /healthz returns ok status", async () => { diff --git a/views/index.ejs b/views/index.ejs index 4f91a36..31870fd 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -1,22 +1,23 @@ - + - Haikus for Mona + + Mona 的俳句 - - + + - + -

Haikus for Mona

+

Mona 的俳句

<% for (const [i, { image, text }] of haikus.entries()) { %> Haiku illustration <%= i + 1 %> + alt="俳句插圖 <%= i + 1 %>" />

<%= text %>