Skip to content

Commit ffbdd55

Browse files
committed
fix formatting
1 parent 961261f commit ffbdd55

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

module1-introduction-to-backend/r1-introduction-to-backend/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ But where does all the data to be displayed on the frontend come from? How is a
2424

2525
A backend developer builds and maintains the code that powers those components which together enable the user-facing side of the website to even exist in the first place. Backend developers must be competent with one or more server-side languages such as JavaScript (Node.js), Ruby, Python, PHP or Java, frameworks like ExpressJS, Ruby on Rails, Python Django and databases like MySQL, PostgreSQL or MongoDB. They are also familiar with Linux as a deployment environment and DevOps tools like AWS, GCP, Apache, Nginx, Docker and Kubernetes.
2626

27-
Backend developers need to be able to navigate across larger codebases and not get lost in the complexities of what may seem like programming labyrinths. They also need to be very meticulous when making changes to not "break" anything as there are usually delicate dependencies. Even frontend codebases are large and complex with delicate dependencies, but unlike frontend development where the written code translates directly to visual output one can see and interact with, backend development of business logic is often hard to visualise. Therefore to be a good backend developer, you need to be comfortable with dealing with abstracts.
27+
Backend developers need to be able to navigate across larger codebases and not get lost in the complexities. They also need to be very meticulous when making changes to not "break" anything as there are usually delicate dependencies. Even frontend codebases are large and complex with delicate dependencies, but unlike frontend development where the written code translates directly to visual output one can see and interact with, backend development of business logic is often hard to visualise. Therefore to be a good backend developer, you need to be comfortable with dealing with abstracts.
2828

2929
<img src="https://drive.google.com/uc?export=view&id=1PkIrF_pNnGbX1NiW-q1JIKokql1v4FI7" width="50%">
3030

@@ -37,7 +37,7 @@ To be a good fullstack developer, you need to be comfortable with dealing with a
3737

3838
<img src="https://drive.google.com/uc?export=view&id=13hdTlUW0tk0J91wV-r7ruPX7uATpt9pe" width="50%">
3939

40-
## Backend web architecture
40+
## Backend Web Architecture
4141
Let's start diving deeper into what do we mean when we say frontend and backend. The frontend is the code that is executed on the client side. This code runs in the user’s browser and creates the user interface. The backend is the code that runs on the server, receives requests from the clients, and contains the logic to send the appropriate data back to the client. The backend also includes the database, which will persistently store all of the data for the application.
4242

4343
### What are clients?

module1-introduction-to-backend/r1.1-beginners-guide-nodejs-npm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ But to be specific, Node.js is an open-source, cross-platform, backend JavaScrip
1212

1313
And here is what a common Hello World code in Node.js would look like:
1414

15-
```
15+
```js
1616
const http = require('http')
1717

1818
const hostname = '127.0.0.1'

module1-introduction-to-backend/r2.1-diving-into-rest-apis/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ HTTP defines a set of request methods to indicate the desired action to be perfo
2020

2121
While developing APIs, GET and POST are the most commonly and frequently used methods.
2222

23-
## Structure of a HTTP Request
23+
## Structure of an HTTP Request
2424

2525
HTTP requests, and responses, share similar structure and are composed of:
2626
1. A start-line describing the requests to be implemented, or its status of whether successful or a failure. This start-line is always a single line.
@@ -67,7 +67,7 @@ Bodies can be broadly divided into two categories:
6767
- Single-resource bodies, consisting of one single file, defined by the two headers: Content-Type and Content-Length.
6868
- Multiple-resource bodies, consisting of a multipart body, each containing a different bit of information. This is typically associated with HTML Forms.
6969
70-
## Structure of a HTTP Response
70+
## Structure of an HTTP Response
7171
7272
The structure is similar to HTTP Requests.
7373

module1-introduction-to-backend/r3-introduction-to-expressjs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ While Express itself is fairly minimalist, developers have created compatible mi
1717

1818
This probably looks quite similar to the Hello World example of plain Node.js.
1919

20-
```
20+
```js
2121
const express = require('express');
2222
const app = express();
2323
const port = 3000;

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Please note: This list is not necessarily exhaustive and there is always room fo
2626
REST APIs should accept JSON for request payload and also send responses to JSON. JSON is the standard for transferring data. Almost every networked technology can use it: JavaScript has built-in methods to encode and decode JSON either through the Fetch API or another HTTP client. Server-side technologies have libraries that can decode JSON without doing much work.
2727

2828
In Express, we can use the body-parser middleware to parse the JSON request body.
29-
```
29+
```js
3030
const express = require('express');
3131
const bodyParser = require('body-parser');
3232

@@ -49,7 +49,7 @@ For example, we should create routes like GET `/articles` for getting news artic
4949
The combination of the HTTP verb and resource noun convey the purpose of an API endpoint. API endpoints like GET `/fetchArticles` or POST `/update-articles` use redundant verbs like "fetch" and "update" which is not required.
5050

5151
In Express, we can write these endpoints as:
52-
```
52+
```js
5353
const express = require('express');
5454
const bodyParser = require('body-parser');
5555

@@ -89,7 +89,7 @@ When designing endpoints, it makes sense to group those that contain associated
8989
For example, if we want an endpoint to get the comments for a news article, we should append the `/comments` path to the end of the `/articles` path.
9090

9191
In Express, we can write this as:
92-
```
92+
```js
9393
const express = require('express');
9494
const bodyParser = require('body-parser');
9595

@@ -123,7 +123,7 @@ To eliminate confusion for API users when an error occurs, we should handle erro
123123
Along with error codes, try to provide good feedback through your response messages. Good feedback involves positive validation on correct implementation, and an informative error on incorrect implementation that can help users debug and correct the way they use the product. Describe your error responses well, but keep them concise and neat.
124124

125125
For example, if we want to reject the data from the request payload, then we should return a 400 response as follows in an Express API:
126-
```
126+
```js
127127
const express = require('express');
128128
const bodyParser = require('body-parser');
129129

@@ -153,7 +153,7 @@ app.listen(3000, () => console.log('server started'));
153153
The databases behind a REST API can get very large. Sometimes, there’s so much data that it shouldn’t be returned all at once because it’s way too slow or will bring down our systems. Therefore, we need ways to filter items. We also need ways to paginate data so that we only return a few results at a time. We don’t want to tie up resources for too long by trying to get all the requested data at once. Filtering and pagination both increase performance by reducing the usage of server resources.
154154

155155
Here’s a small example where an API can accept a query string with various query parameters to let us filter out items by their fields:
156-
```
156+
```js
157157
const express = require('express');
158158
const bodyParser = require('body-parser');
159159

@@ -209,7 +209,7 @@ This way, we can gradually phase out old endpoints instead of forcing everyone t
209209
Versioning is usually done with `/v1/`, `/v2/`, etc. added at the start of the API path.
210210

211211
For example, we can do that with Express as follows:
212-
```
212+
```js
213213
const express = require('express');
214214
const bodyParser = require('body-parser');
215215
const app = express();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You might be thinking do I have to write a bunch of if statements within my API
2424
We will be learning to use [express-validator](https://express-validator.github.io/docs/) in the next assignment.
2525

2626
Consider this piece of code:
27-
```
27+
```js
2828
// ...initial code omitted for simplicity
2929
const { body, validationResult } = require('express-validator');
3030

@@ -47,7 +47,7 @@ app.post(
4747
```
4848

4949
Now, whenever a request that includes invalid username or password fields is submitted, your server will respond with a 400 error response like this:
50-
```
50+
```json
5151
{
5252
"errors": [
5353
{

0 commit comments

Comments
 (0)