Skip to content

Commit 8d0eb01

Browse files
committed
updated
1 parent 38fd756 commit 8d0eb01

File tree

2 files changed

+163
-1
lines changed

2 files changed

+163
-1
lines changed

Note App.postman_collection.json

+162
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
{
2+
"info": {
3+
"_postman_id": "5a0ef1af-7659-43bc-8ecb-aeffd04c6a6c",
4+
"name": "Note App",
5+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
6+
"_exporter_id": "14791724"
7+
},
8+
"item": [
9+
{
10+
"name": "Create Note",
11+
"request": {
12+
"method": "POST",
13+
"header": [],
14+
"body": {
15+
"mode": "raw",
16+
"raw": "{\r\n \"title\": \"You'll learn how to build a CRUD API with FastAPI\",\r\n \"content\": \"Fastapi is really easy to use\",\r\n \"category\": \"FastAPI\"\r\n}",
17+
"options": {
18+
"raw": {
19+
"language": "json"
20+
}
21+
}
22+
},
23+
"url": {
24+
"raw": "http://localhost:8000/api/notes/",
25+
"protocol": "http",
26+
"host": [
27+
"localhost"
28+
],
29+
"port": "8000",
30+
"path": [
31+
"api",
32+
"notes",
33+
""
34+
]
35+
}
36+
},
37+
"response": []
38+
},
39+
{
40+
"name": "Get Note",
41+
"request": {
42+
"method": "GET",
43+
"header": [],
44+
"url": {
45+
"raw": "http://localhost:8000/api/notes/cc5ff528-5352-4ba3-9b75-962dc5dacf2f",
46+
"protocol": "http",
47+
"host": [
48+
"localhost"
49+
],
50+
"port": "8000",
51+
"path": [
52+
"api",
53+
"notes",
54+
"cc5ff528-5352-4ba3-9b75-962dc5dacf2f"
55+
]
56+
}
57+
},
58+
"response": []
59+
},
60+
{
61+
"name": "Health Checker",
62+
"request": {
63+
"method": "GET",
64+
"header": [],
65+
"url": {
66+
"raw": "http://localhost:8000/api/healthchecker",
67+
"protocol": "http",
68+
"host": [
69+
"localhost"
70+
],
71+
"port": "8000",
72+
"path": [
73+
"api",
74+
"healthchecker"
75+
]
76+
}
77+
},
78+
"response": []
79+
},
80+
{
81+
"name": "Update Note",
82+
"request": {
83+
"method": "PATCH",
84+
"header": [],
85+
"body": {
86+
"mode": "raw",
87+
"raw": "{\r\n \"title\": \"✅✅👇👇This article will teach Django REST framework\"\r\n}",
88+
"options": {
89+
"raw": {
90+
"language": "json"
91+
}
92+
}
93+
},
94+
"url": {
95+
"raw": "http://localhost:8000/api/notes/77a9ac3c-7e3b-40c1-b2d4-30729c931d3d",
96+
"protocol": "http",
97+
"host": [
98+
"localhost"
99+
],
100+
"port": "8000",
101+
"path": [
102+
"api",
103+
"notes",
104+
"77a9ac3c-7e3b-40c1-b2d4-30729c931d3d"
105+
]
106+
}
107+
},
108+
"response": []
109+
},
110+
{
111+
"name": "Delete Note",
112+
"request": {
113+
"method": "DELETE",
114+
"header": [],
115+
"url": {
116+
"raw": "http://localhost:8000/api/notes/04aae95f-de90-4a39-9610-83b84485a042",
117+
"protocol": "http",
118+
"host": [
119+
"localhost"
120+
],
121+
"port": "8000",
122+
"path": [
123+
"api",
124+
"notes",
125+
"04aae95f-de90-4a39-9610-83b84485a042"
126+
]
127+
}
128+
},
129+
"response": []
130+
},
131+
{
132+
"name": "Get All Notes",
133+
"request": {
134+
"method": "GET",
135+
"header": [],
136+
"url": {
137+
"raw": "http://localhost:8000/api/notes?page=1&limit=10",
138+
"protocol": "http",
139+
"host": [
140+
"localhost"
141+
],
142+
"port": "8000",
143+
"path": [
144+
"api",
145+
"notes"
146+
],
147+
"query": [
148+
{
149+
"key": "page",
150+
"value": "1"
151+
},
152+
{
153+
"key": "limit",
154+
"value": "10"
155+
}
156+
]
157+
}
158+
},
159+
"response": []
160+
}
161+
]
162+
}

src/db.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl DB {
2626
let mut client_options = ClientOptions::parse(mongodb_uri).await?;
2727
client_options.app_name = Some(database_name.to_string());
2828

29-
let client = Client::with_options(client_options).unwrap();
29+
let client = Client::with_options(client_options)?;
3030
let database = client.database(database_name.as_str());
3131

3232
let note_collection = database.collection(mongodb_note_collection.as_str());

0 commit comments

Comments
 (0)