Conversation
Deploying utcode-learn with
|
| Latest commit: |
5348fe9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1e26a8b2.utcode-learn.pages.dev |
| Branch Preview URL: | https://change-chat-app-response-sta.utcode-learn.pages.dev |
33b293a to
2d03af3
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the chat application and forum examples to return appropriate HTTP status codes when creating new resources. Previously, the /send endpoints used response.send() without specifying a status code, but following issue #860, these endpoints now properly return 201 (Created) status code using response.sendStatus(201).
- Updated all POST endpoints that create messages/posts to return 201 (Created) status code
- Added 201 (Created) to the HTTP status code term definition
- Updated documentation to instruct readers to return appropriate status codes
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/Term/definitions.js | Added 201 (Created) to the list of representative HTTP status codes in the definition |
| docs/3-web-servers/07-fetch-api-post/index.mdx | Updated documentation and code examples to use response.sendStatus(201) for message creation |
| docs/3-web-servers/07-fetch-api-post/_samples/chat-app/main.mjs | Updated actual chat app sample code to return 201 status when creating messages |
| docs/3-web-servers/08-database/index.mdx | Updated documentation example to use response.sendStatus(201) for post creation |
| docs/3-web-servers/08-database/_samples/forum/main.mjs | Updated actual forum sample code to return 201 status when creating posts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
今まではステータスコードを扱っていなかったため
response.send()のように書かれていたが、 #860 によりステータスコードを扱うようになったため、「Fetch APIによるデータの送信」と「データベース」の節でもステータスコードを適切に返すように変更しました。