Skip to content

Conversation

@chvmvd
Copy link
Contributor

@chvmvd chvmvd commented Dec 7, 2025

今まではステータスコードを扱っていなかったためresponse.send()のように書かれていたが、 #860 によりステータスコードを扱うようになったため、「Fetch APIによるデータの送信」と「データベース」の節でもステータスコードを適切に返すように変更しました。

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 7, 2025

Deploying utcode-learn with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2d03af3
Status: ✅  Deploy successful!
Preview URL: https://783fdc90.utcode-learn.pages.dev
Branch Preview URL: https://change-chat-app-response-sta.utcode-learn.pages.dev

View logs

@chvmvd chvmvd force-pushed the change-chat-app-response-status-code branch from 33b293a to 2d03af3 Compare December 13, 2025 01:16
@chvmvd chvmvd requested a review from Copilot December 13, 2025 01:20
@chvmvd chvmvd marked this pull request as ready for review December 13, 2025 01:20
Copy link

Copilot AI left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants