Skip to content

Commit bfce6b5

Browse files
authored
Merge pull request #3426 from pablo-maff/part3-spanish
Part3 spanish
2 parents e16b7cf + f0ed32c commit bfce6b5

File tree

11 files changed

+844
-712
lines changed

11 files changed

+844
-712
lines changed

src/content/1/es/part1d.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ Programar es difícil, por eso usaré todos los medios posibles para hacerlo má
11321132

11331133
<h3> Ejercicios 1.6.-1.14.</h3>
11341134

1135-
Envía tus soluciones a los ejercicios enviando primero su código a GitHub y luego marcando los ejercicios completados en el [sistema de envío de ejercicios](https://studies.cs.helsinki.fi/stats/courses/fullstackopen).
1135+
Envía tus soluciones a los ejercicios enviando primero tu código a GitHub y luego marcando los ejercicios completados en el [sistema de envío de ejercicios](https://studies.cs.helsinki.fi/stats/courses/fullstackopen).
11361136

11371137
Recuerda, envía **todos** los ejercicios de una parte **en una sola presentación**. Una vez que hayas enviado tus soluciones para una parte, **ya no podrás enviar más ejercicios a esa parte**.
11381138

@@ -1277,7 +1277,7 @@ Entonces realiza las acciones necesarias para que la advertencia desaparezca. In
12771277

12781278
<h4>1.12*: anecdotes, paso 1</h4>
12791279

1280-
El mundo de la ingeniería de software está lleno con [anécdotas](http://www.comp.nus.edu.sg/~damithch/pages/SE-quotes.htm) que destilan verdades atemporales de nuestro campo en breves frases.
1280+
El mundo de la ingeniería de software está lleno de [anécdotas](http://www.comp.nus.edu.sg/~damithch/pages/SE-quotes.htm) que destilan verdades atemporales de nuestro campo en breves frases.
12811281

12821282
Expande la siguiente aplicación agregando un botón en el que se pueda hacer clic para mostrar una anécdota <i>aleatoria</i> del campo de la ingeniería de software:
12831283

src/content/3/en/part3a.md

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Let's take a closer look at the first line of the code:
146146
const http = require('http')
147147
```
148148

149-
In the first row, the application imports Node's built-in [web server](https://nodejs.org/docs/latest-v8.x/api/http.html) module. This is practically what we have already been doing in our browser-side code, but with a slightly different syntax:
149+
In the first row, the application imports Node's built-in [web server](https://nodejs.org/docs/latest-v18.x/api/http.html) module. This is practically what we have already been doing in our browser-side code, but with a slightly different syntax:
150150

151151
```js
152152
import http from 'http'
@@ -167,7 +167,7 @@ const app = http.createServer((request, response) => {
167167
})
168168
```
169169

170-
The code uses the _createServer_ method of the [http](https://nodejs.org/docs/latest-v8.x/api/http.html) module to create a new web server. An <i>event handler</i> is registered to the server that is called <i>every time</i> an HTTP request is made to the server's address <http://localhost:3001>.
170+
The code uses the _createServer_ method of the [http](https://nodejs.org/docs/latest-v18.x/api/http.html) module to create a new web server. An <i>event handler</i> is registered to the server that is called <i>every time</i> an HTTP request is made to the server's address <http://localhost:3001>.
171171

172172
The request is responded to with the status code 200, with the <i>Content-Type</i> header set to <i>text/plain</i>, and the content of the site to be returned set to <i>Hello World</i>.
173173

@@ -224,7 +224,7 @@ When we open the browser, the displayed format is exactly the same as in [part 2
224224

225225
### Express
226226

227-
Implementing our server code directly with Node's built-in [http](https://nodejs.org/docs/latest-v8.x/api/http.html) web server is possible. However, it is cumbersome, especially once the application grows in size.
227+
Implementing our server code directly with Node's built-in [http](https://nodejs.org/docs/latest-v18.x/api/http.html) web server is possible. However, it is cumbersome, especially once the application grows in size.
228228

229229
Many libraries have been developed to ease server-side development with Node, by offering a more pleasing interface to work with the built-in http module. These libraries aim to provide a better abstraction for general use cases we usually require to build a backend server. By far the most popular library intended for this purpose is [express](http://expressjs.com).
230230

@@ -247,7 +247,7 @@ The dependency is also added to our <i>package.json</i> file:
247247

248248
The source code for the dependency is installed in the <i>node\_modules</i> directory located at the root of the project. In addition to express, you can find a great number of other dependencies in the directory:
249249

250-
![ls listing of dependencies in directory](../../images/3/4.png)
250+
![ls command listing of dependencies in directory](../../images/3/4.png)
251251

252252
These are the dependencies of the express library and the dependencies of all of its dependencies, and so forth. These are called the [transitive dependencies](https://lexi-lambda.github.io/blog/2016/08/24/understanding-the-npm-dependency-model/) of our project.
253253

@@ -257,7 +257,7 @@ The version 4.18.2 of express was installed in our project. What does the caret
257257
"express": "^4.18.2"
258258
```
259259

260-
The versioning model used in npm is called [semantic versioning](https://docs.npmjs.com/getting-started/semantic-versioning).
260+
The versioning model used in npm is called [semantic versioning](https://docs.npmjs.com/about-semantic-versioning).
261261

262262
The caret in the front of <i>^4.18.2</i> means that if and when the dependencies of a project are updated, the version of express that is installed will be at least <i>4.18.2</i>. However, the installed version of express can also have a larger <i>patch</i> number (the last number), or a larger <i>minor</i> number (the middle number). The major version of the library indicated by the first <i>major</i> number must be the same.
263263

@@ -301,7 +301,7 @@ app.listen(PORT, () => {
301301
})
302302
```
303303

304-
To get the new version of our application into use, we have to restart the application.
304+
To get the new version of our application into use, first we have to restart it.
305305

306306
The application did not change a whole lot. Right at the beginning of our code, we're importing _express_, which this time is a <i>function</i> that is used to create an express application stored in the _app_ variable:
307307

@@ -354,7 +354,7 @@ The experiment shown below illustrates this point:
354354

355355
![node terminal demonstrating json is of type string](../../assets/3/5.png)
356356

357-
The experiment above was done in the interactive [node-repl](https://nodejs.org/docs/latest-v8.x/api/repl.html). You can start the interactive node-repl by typing in _node_ in the command line. The repl is particularly useful for testing how commands work while you're writing application code. I highly recommend this!
357+
The experiment above was done in the interactive [node-repl](https://nodejs.org/docs/latest-v18.x/api/repl.html). You can start the interactive node-repl by typing in _node_ in the command line. The repl is particularly useful for testing how commands work while you're writing application code. I highly recommend this!
358358

359359
### nodemon
360360

@@ -632,7 +632,7 @@ If you use *IntelliJ WebStorm* instead, you can use a similar procedure with its
632632

633633
### Receiving data
634634

635-
Next, let's make it possible to add new notes to the server. Adding a note happens by making an HTTP POST request to the address <http://localhost:3001/api/notes>, and by sending all the information for the new note in the request [body](https://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7) in JSON format.
635+
Next, let's make it possible to add new notes to the server. Adding a note happens by making an HTTP POST request to the address <http://localhost:3001/api/notes>, and by sending all the information for the new note in the request [body](https://www.rfc-editor.org/rfc/rfc9112#name-message-body) in JSON format.
636636

637637
To access the data easily, we need the help of the express [json-parser](https://expressjs.com/en/api.html) that we can use with the command _app.use(express.json())_.
638638

@@ -799,8 +799,6 @@ If the data saved in the _body_ variable has the <i>important</i> property, the
799799
800800
You can find the code for our current application in its entirety in the <i>part3-1</i> branch of [this GitHub repository](https://github.com/fullstack-hy2020/part3-notes-backend/tree/part3-1).
801801

802-
The code for the current state of the application is specified in branch [part3-1](https://github.com/fullstack-hy2020/part3-notes-backend/tree/part3-1).
803-
804802
![GitHub screenshot of branch 3-1](../../images/3/21.png)
805803

806804
If you clone the project, run the _npm install_ command before starting the application with _npm start_ or _npm run dev_.
@@ -828,7 +826,6 @@ What exactly is happening in that line of code? <em>notes.map(n => n.id)</em> cr
828826

829827
<div class="tasks">
830828

831-
832829
### Exercises 3.1.-3.6.
833830

834831
**NB:** It's recommended to do all of the exercises from this part into a new dedicated git repository, and place your source code right at the root of the repository. Otherwise, you will run into problems in exercise 3.10.
@@ -837,7 +834,7 @@ What exactly is happening in that line of code? <em>notes.map(n => n.id)</em> cr
837834

838835
**Strong recommendation:** When you are working on backend code, always keep an eye on what's going on in the terminal that is running your application.
839836

840-
#### 3.1: Phonebook backend step1
837+
#### 3.1: Phonebook backend step 1
841838

842839
Implement a Node application that returns a hardcoded list of phonebook entries from the address <http://localhost:3001/api/persons>.
843840

@@ -878,7 +875,7 @@ The application must be started with the command _npm start_.
878875

879876
The application must also offer an _npm run dev_ command that will run the application and restart the server whenever changes are made and saved to a file in the source code.
880877

881-
#### 3.2: Phonebook backend step2
878+
#### 3.2: Phonebook backend step 2
882879

883880
Implement a page at the address <http://localhost:3001/info> that looks roughly like this:
884881

@@ -890,25 +887,25 @@ There can only be one response.send() statement in an Express app route. Once yo
890887

891888
To include a line space in the output, use `<br/>` tag, or wrap the statements in `<p>` tags.
892889

893-
#### 3.3: Phonebook backend step3
890+
#### 3.3: Phonebook backend step 3
894891

895892
Implement the functionality for displaying the information for a single phonebook entry. The url for getting the data for a person with the id 5 should be <http://localhost:3001/api/persons/5>
896893

897894
If an entry for the given id is not found, the server has to respond with the appropriate status code.
898895

899-
#### 3.4: Phonebook backend step4
896+
#### 3.4: Phonebook backend step 4
900897

901898
Implement functionality that makes it possible to delete a single phonebook entry by making an HTTP DELETE request to the unique URL of that phonebook entry.
902899

903900
Test that your functionality works with either Postman or the Visual Studio Code REST client.
904901

905-
#### 3.5: Phonebook backend step5
902+
#### 3.5: Phonebook backend step 5
906903

907904
Expand the backend so that new phonebook entries can be added by making HTTP POST requests to the address <http://localhost:3001/api/persons>.
908905

909906
Generate a new id for the phonebook entry with the [Math.random](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random) function. Use a big enough range for your random values so that the likelihood of creating duplicate ids is small.
910907

911-
#### 3.6: Phonebook backend step6
908+
#### 3.6: Phonebook backend step 6
912909

913910
Implement error handling for creating new entries. The request is not allowed to succeed, if:
914911

@@ -1005,15 +1002,15 @@ You can find the code for our current application in its entirety in the <i>part
10051002

10061003
### Exercises 3.7.-3.8.
10071004

1008-
#### 3.7: Phonebook backend step7
1005+
#### 3.7: Phonebook backend step 7
10091006

10101007
Add the [morgan](https://github.com/expressjs/morgan) middleware to your application for logging. Configure it to log messages to your console based on the <i>tiny</i> configuration.
10111008

10121009
The documentation for Morgan is not the best, and you may have to spend some time figuring out how to configure it correctly. However, most documentation in the world falls under the same category, so it's good to learn to decipher and interpret cryptic documentation in any case.
10131010

10141011
Morgan is installed just like all other libraries with the _npm install_ command. Taking morgan into use happens the same way as configuring any other middleware by using the _app.use_ command.
10151012

1016-
#### 3.8*: Phonebook backend step8
1013+
#### 3.8*: Phonebook backend step 8
10171014

10181015
Configure morgan so that it also shows the data sent in HTTP POST requests:
10191016

0 commit comments

Comments
 (0)