Skip to content

Conversation

@chvmvd
Copy link
Contributor

@chvmvd chvmvd commented Dec 6, 2025

チャットアプリと掲示板のPOSTリクエストのエンドポイントの命名が不適切であったため、/sendから/messagesあるいは/postsに修正しました。

@chvmvd chvmvd marked this pull request as ready for review December 6, 2025 14:44
@cloudflare-workers-and-pages
Copy link

Deploying utcode-learn with  Cloudflare Pages  Cloudflare Pages

Latest commit: b68af7a
Status: ✅  Deploy successful!
Preview URL: https://b5546d5e.utcode-learn.pages.dev
Branch Preview URL: https://rename-chat-app-endpoint.utcode-learn.pages.dev

View logs

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 refactors the endpoint naming convention from action-based (/send) to resource-based RESTful naming (/messages for the chat app and /posts for the forum app). This improves API consistency by using the same resource path with different HTTP methods (GET and POST) for retrieving and creating resources, following REST best practices.

Key Changes:

  • Chat app endpoints: Changed POST /send to POST /messages to match the existing GET /messages endpoint
  • Forum app endpoints: Changed POST /send to POST /posts to match the existing GET /posts endpoint
  • Updated all documentation and code samples to reflect the new endpoint naming

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
docs/3-web-servers/08-database/index.mdx Updated tutorial documentation for the forum app to reference /posts instead of /send for POST requests in instructions and code examples
docs/3-web-servers/08-database/_samples/forum/public/script.js Updated client-side JavaScript to send POST requests to /posts endpoint
docs/3-web-servers/08-database/_samples/forum/main.mjs Updated server-side endpoint handler from app.post("/send") to app.post("/posts")
docs/3-web-servers/07-fetch-api-post/index.mdx Updated tutorial documentation for the chat app to reference /messages instead of /send for POST requests in instructions and code examples
docs/3-web-servers/07-fetch-api-post/_samples/chat-app/public/script.js Updated client-side JavaScript to send POST requests to /messages endpoint
docs/3-web-servers/07-fetch-api-post/_samples/chat-app/main.mjs Updated server-side endpoint handler from app.post("/send") to app.post("/messages")

💡 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