-
Notifications
You must be signed in to change notification settings - Fork 3
チャットアプリと掲示板のステータスコードを修正 #902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Deploying utcode-learn with
|
| Latest commit: |
5d99059
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7e8071c6.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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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によるデータの送信」と「データベース」の節でもステータスコードを適切に返すように変更しました。