Skip to content

Commit cd4a826

Browse files
committed
small fixes
1 parent 57fbc0b commit cd4a826

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

module1-introduction-to-backend/r2-http-and-rest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ HTTPS uses an encryption protocol called [Transport Layer Security (TLS)](https:
6767
1. **Private key**: This key is controlled by the owner of a website and it's kept, as you might have guessed, private. This key lives on a web server and is used to decrypt information encrypted by the public key.
6868
2. **Public key**: This key is available to everyone who wants to interact with the server in a way that's secure. Information that's encrypted by the public key can only be decrypted by the private key.
6969

70-
HTTPS prevents websites from having their information broadcast in a way that's easily viewed by anyone snooping on the network. When information is sent over regular HTTP, the information is broken into packets of data that can be easily sniffed using some software tools. This makes communication over an unsecure medium, such as public WiFi in a cafe, highly vulnerable to interception. In fact, all communications that occur over HTTP occur in plain text, making them highly accessible to anyone with the correct tools, and vulnerable to on-path attacks.
70+
HTTPS prevents websites from having their information broadcast in a way that's easily viewed by anyone snooping on the network. When information is sent over regular HTTP, the information is broken into packets of data that can be easily "sniffed" using some software tools. This makes communication over an unsecure medium, such as public WiFi in a cafe, highly vulnerable to interception. In fact, all communications that occur over HTTP occur in plain text, making them highly accessible to anyone with the correct tools, and vulnerable to on-path attacks.
7171

7272
With HTTPS, traffic is encrypted such that even if the packets are sniffed or otherwise intercepted, they will come across as nonsensical characters.
7373

module1-introduction-to-backend/r4-api-best-practices/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ app.listen(3000, () => console.log('server started'));
109109
```
110110

111111
### 4. Handle complexity elegantly
112-
Instead of defining more and more resources and endpoints to cover dynamic use cases and relationships, you can sweep properties and limit responses behind the ?' in a query parameter, or isolate specific component of the data the client is working with using a path parameter.
112+
Instead of defining more and more resources and endpoints to cover dynamic use cases and relationships, you can sweep properties and limit responses behind the '?' in a query parameter, or isolate specific component of the data the client is working with using a path parameter.
113113

114114
For example, let's consider a photosharing app. It could be of use to developers to get information on all the photos shared in a particular location and a specific hashtag. You also want to limit the number of results to 10 per API call to prevent server load. If the end user wants to find all photos in Boston with a hashtag #winter, the call would be: `GET /photos?location=boston&hashtag=winter&limit=10`. Here `location`, `hashtag` and `limit` are query parameters. However, if the end user wants to find a specific photo by its ID, the call would be: `GET /photos/13214` where the ID 13214 is a path parameter.
115115

module1-introduction-to-backend/r4.1-server-side-validation/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ tsa_b
107107
{"errors":[{"code":215,"message":"Bad Authentication data."}]}
108108
```
109109

110-
Looking at this data, we can generally figure out what our issue is. First, we're told that we've submitted a 400 Bad Request. This tells us that the problem is somewhere in our request. Our content length is acceptable, and our response time is well within normal limits. We can see, however, that we're receiving a unique error code that Twitter itself has denoted — 215, with an attached message that states Bad Authentication data. This tells us that the fix is to supply authentication data, but also gives us a number to reference on the internal documentation of the Twitter API for further details.
110+
Looking at this data, we can generally figure out what our issue is. First, we're told that we've submitted a 400 Bad Request. This tells us that the problem is somewhere in our request. Our content length is acceptable, and our response time is well within normal limits. We can see, however, that we're receiving a unique error code that Twitter itself has denoted — "215", with an attached message that states "Bad Authentication data". This tells us that the fix is to supply authentication data, but also gives us a number to reference on the internal documentation of the Twitter API for further details.
111111

112112
### Facebook API
113113
Let's pass a GET request to ascertain some details about a user. All personal information will be blanked out for security purposes.
@@ -127,7 +127,7 @@ This request should give us a few basic fields from this user's Facebook profile
127127
}
128128
```
129129

130-
While Facebook doesn't directly pass the HTTP error code in the body, it does pass a lot of useful information. The message area notes that we've run into a syntax error, specifically that we've defined the picture field more than once. Additionally, this field lets us know that this behavior was possible in previous versions, which is a very useful tool to communicate to users a change in behavior from previous versions to the current. Additionally, we are provided both a code and an `fbtrace_id` that can be used with support to identify specific issues in more complex cases. We've also received a specific error type, in this case `OAuthException`, which can be used to narrow down the specifics of the case even further.
130+
While Facebook doesn't directly pass the HTTP error code in the body, it does pass a lot of useful information. The "message" area notes that we've run into a syntax error, specifically that we've defined the "picture" field more than once. Additionally, this field lets us know that this behavior was possible in previous versions, which is a very useful tool to communicate to users a change in behavior from previous versions to the current. Additionally, we are provided both a code and an `fbtrace_id` that can be used with support to identify specific issues in more complex cases. We've also received a specific error type, in this case `OAuthException`, which can be used to narrow down the specifics of the case even further.
131131

132132
Let's put these learnings about validation into practice in the next assignment.
133133

module3-crud-and-data-models/r1-schema-and-data-models/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Introduction To Database Schemas
22

3-
A database schema is a blueprint or architecture of how our data will look. It doesnt hold data itself, but instead describes the shape and structure of the data and how it might be related to other data.
3+
A database schema is a blueprint or architecture of how our data will look. It doesn't hold data itself, but instead describes the shape and structure of the data and how it might be related to other data.
44

55
For example, this is a `customer` schema in MongoDB using Mongoose.
66

@@ -52,7 +52,7 @@ When we are building APIs, we want our models to provide four basic types of fun
5252

5353
In a REST environment, CRUD often corresponds to the [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) `POST`, `GET`, `PUT`, and `DELETE`, respectively. These are the fundamental elements of a persistent storage system.
5454

55-
For example, imagine we are working with a system that is keeping track of meals and their corresponding prices for a restaurant. Lets look at how we would implement CRUD operations.
55+
For example, imagine we are working with a system that is keeping track of meals and their corresponding prices for a restaurant. Let's look at how we would implement CRUD operations.
5656

5757
First of all, we need to define our food item schema (we will use mongoose for that), and let's call it "dish".
5858

@@ -194,7 +194,7 @@ router.put("/dishes/:id", async (req, res) => {
194194
#### Delete
195195

196196
The CRUD operation Delete corresponds to the HTTP method DELETE. It is used to remove a resource from the system.
197-
Lets say that the world avocado shortage has reached a critical point, and we can no longer afford to serve this modern delicacy at all. We should go into the database and delete the item that corresponds to **Avocado Toast**, which we know has an `id` of 1223.
197+
Let's say that the world avocado shortage has reached a critical point, and we can no longer afford to serve this modern delicacy at all. We should go into the database and delete the item that corresponds to **Avocado Toast**, which we know has an `id` of 1223.
198198

199199
Request:
200200

module3-crud-and-data-models/r1.1-model-view-controller/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ package-lock.json
3030
In this folder, you can write the functionality & logics related to the database (if you aren't using ORM) like insert, fetch, update, delete queries. It takes the query request from the controller & sends the response back to the controller.
3131
The naming convention for the model files is: `name-here-model.js`.
3232

33-
Heres an example model using JavaScript and Mongoose.
33+
Here's an example model using JavaScript and Mongoose.
3434

3535
```js
3636
// post-model.js

module3-crud-and-data-models/r1.3-principles-of-setting-up-your-schema/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Poorly designed databases can cause many problems, including wasting resources, making maintenance difficult, and hindering performance. That's why having a great database schema design is a crucial part of effective data management.
44
By defining categories of data and relationships between those categories, database schema design makes data much easier to retrieve, consume, manipulate, and interpret.
5-
Without a clean, efficient, consistent database schema, youll struggle to make the best use of your enterprise data. For example, the same data might be duplicated in multiple locations—or even worse, might be inconsistent between these locations.
5+
Without a clean, efficient, consistent database schema, you'll struggle to make the best use of your enterprise data. For example, the same data might be duplicated in multiple locations—or even worse, might be inconsistent between these locations.
66

77
## Type of database
88

0 commit comments

Comments
 (0)