-
Notifications
You must be signed in to change notification settings - Fork 3
フロントエンドとバックエンドの連携とデプロイの節を追加 #890
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
28be016
フロントエンドとバックエンドの連携とデプロイの節を追加
chvmvd 5c605c9
タイポを修正
chvmvd c452c5f
Prismaのバージョンを6.19.0から7.1.0にアップデート
chvmvd 57027b2
フォーマット
chvmvd cf397f7
WIP
chvmvd 6d6ddc8
WIP
chvmvd 1529a0a
フロントエンドとバックエンドの連携とデプロイの節を修正
chvmvd eeaf1d7
デプロイの動画をトリミング
chvmvd a850023
説明を微修正
chvmvd 643f2e8
「開発用サーバー」の記述を「Webサーバー」に修正
chvmvd 8799ed5
Merge branch 'main' into add-deploy-chapter
chvmvd 57fdf66
説明を修正
chvmvd d8538b4
節の参照の表記を修正
chvmvd 40a6dbd
説明を修正
chvmvd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
docs/4-advanced/05-integration-and-deployment/_samples/fullstack-app/backend/.env.sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| DATABASE_URL="" | ||
| WEB_ORIGIN="http://localhost:5173" |
4 changes: 4 additions & 0 deletions
4
docs/4-advanced/05-integration-and-deployment/_samples/fullstack-app/backend/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /node_modules | ||
| /.env | ||
| /generated/prisma | ||
| /dist |
20 changes: 20 additions & 0 deletions
20
docs/4-advanced/05-integration-and-deployment/_samples/fullstack-app/backend/main.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import express from "express"; | ||
| import cors from "cors"; | ||
| import { PrismaClient } from "./generated/prisma/client.js"; | ||
|
|
||
| const app = express(); | ||
| const client = new PrismaClient(); | ||
| app.use(express.json()); | ||
| app.use(cors({ origin: process.env.WEB_ORIGIN })); | ||
|
|
||
| app.get("/posts", async (request, response) => { | ||
| const posts = await client.post.findMany(); | ||
| response.json(posts); | ||
| }); | ||
|
|
||
| app.post("/send", async (request, response) => { | ||
| await client.post.create({ data: { message: request.body.message } }); | ||
chvmvd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| response.send(); | ||
|
||
| }); | ||
|
|
||
| app.listen(3000); | ||
chvmvd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
RESTful なら
POST /postsなのでそうすべき?