Skip to content

Commit 626e76a

Browse files
authored
Update part3c.md: Translate Exercises 3.15.-3.18.
1 parent 2d1c0f1 commit 626e76a

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

src/content/3/zh/part3c.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ app.get('/api/notes/:id', (request, response) => {
724724
<!-- Once we introduce a database into the mix, it is useful to inspect the state persisted in the database, e.g. from the control panel in MongoDB Atlas. Quite often little Node helper programs like the <i>mongo.js</i> program we wrote earlier can be very helpful during development.-->
725725
一旦我们引入数据库,检查数据库中持久化的状态是很有用的,例如从MongoDB Atlas的控制面板中。很多时候,像我们之前写的<i>mongo.js</i>程序这样的小Node辅助程序在开发过程中会很有帮助。
726726

727-
<!-- You can find the code for our current application in its entirety in the <i>part3-4</i> branch of [this GitHub repository](https://github.com/fullstack-hy2020/part3-notes-backend/tree/part3-4).-->
727+
<!-- You can find the code for our current application in its entirety in the <i>part3-4</i> branch of [this GitHub repository](https://github.com/fullstack-hy2020/part3-notes-backend/tree/part3-4). -->
728728
你可以在[这个Github仓库](https://github.com/fullstack-hy2020/part3-notes-backend/tree/part3-4)的<i>part3-4</i>分支中找到我们当前应用的全部代码。
729729

730730
</div>
@@ -1067,7 +1067,7 @@ app.put('/api/notes/:id', (request, response, next) => {
10671067

10681068
在使用 Postman 和 VS Code REST 客户端直接测试后端之后,我们可以确认它似乎可以正常工作。前端似乎也能够与使用数据库的后端正常工作。
10691069

1070-
You can find the code for our current application in its entirety in the <i>part3-5</i> branch of [this GitHub repository](https://github.com/fullstack-hy2020/part3-notes-backend/tree/part3-5).
1070+
<!-- You can find the code for our current application in its entirety in the <i>part3-5</i> branch of [this GitHub repository](https://github.com/fullstack-hy2020/part3-notes-backend/tree/part3-5). -->
10711071

10721072
你可以在[这个Github仓库](https://github.com/fullstack-hy2020/part3-notes-backend/tree/part3-5) 的 <i>part3-5</i> 分支中找到我们当前应用的全部代码。
10731073

@@ -1079,27 +1079,43 @@ You can find the code for our current application in its entirety in the <i>part
10791079

10801080
#### 3.15: Phonebook database, step3
10811081

1082-
Change the backend so that deleting phonebook entries is reflected in the database.
1082+
<!-- Change the backend so that deleting phonebook entries is reflected in the database. -->
10831083

1084-
Verify that the frontend still works after making the changes.
1084+
更改后端,使删除电话簿条目会让数据库做出响应改变。
1085+
1086+
<!-- Verify that the frontend still works after making the changes. -->
1087+
1088+
验证前台在修改后是否仍能工作。
10851089

10861090
#### 3.16: Phonebook database, step4
10871091

1088-
Move the error handling of the application to a new error handler middleware.
1092+
<!-- Move the error handling of the application to a new error handler middleware. -->
1093+
1094+
将应用程序的错误处理移动到一个新的错误处理中间件。
10891095

10901096
#### 3.17*: Phonebook database, step5
10911097

1092-
If the user tries to create a new phonebook entry for a person whose name is already in the phonebook, the frontend will try to update the phone number of the existing entry by making an HTTP PUT request to the entry's unique URL.
1098+
<!-- If the user tries to create a new phonebook entry for a person whose name is already in the phonebook, the frontend will try to update the phone number of the existing entry by making an HTTP PUT request to the entry's unique URL. -->
1099+
1100+
如果用户尝试为已经在电话簿中的人创建一个新的电话簿条目,前端将尝试通过向条目的唯一 URL发出 HTTP PUT 请求来更新现有条目的电话号码。
10931101

1094-
Modify the backend to support this request.
1102+
<!-- Modify the backend to support this request. -->
10951103

1096-
Verify that the frontend works after making your changes.
1104+
修改后端以支持这个请求。
1105+
1106+
<!-- Verify that the frontend works after making your changes. -->
1107+
1108+
验证前端在修改后是否仍能工作。
10971109

10981110
#### 3.18*: Phonebook database step6
10991111

1100-
Also update the handling of the <i>api/persons/:id</i> and <i>info</i> routes to use the database, and verify that they work directly with the browser, Postman, or VS Code REST client.
1112+
<!-- Also update the handling of the <i>api/persons/:id</i> and <i>info</i> routes to use the database, and verify that they work directly with the browser, Postman, or VS Code REST client. -->
1113+
1114+
同时更新 <i>api/persons/:id</i> 和 <i>info</i> 路由的处理,以使用数据库,并验证它们是否可以直接与浏览器、Postman 或 VS Code REST 客户端一起工作。
1115+
1116+
<!-- Inspecting an individual phonebook entry from the browser should look like this: -->
11011117

1102-
Inspecting an individual phonebook entry from the browser should look like this:
1118+
用浏览器检查单独的电话条目应该像这样:
11031119

11041120
![](../../images/3/49.png)
11051121

0 commit comments

Comments
 (0)