@@ -260,11 +260,9 @@ Assuming you have 8.11.1, it should show something similar to this: `v8.11.1`. |
260 | 260 |
|
261 | 261 | If you want to switch between multiple versions of Node.js, there are solutions for that: |
262 | 262 |
|
263 | | -- [*nvm*](https://github.com/creationix/nvm) (https://github.com/creationix/nvm ): Node.js Version Manager |
264 | | -- [*Nave*](https://github.com/isaacs/nave) |
265 | | - (https://github.com/isaacs/nave): Virtual environments for Node.js |
266 | | -- [*n*](https://github.com/tj/n) ( <https://github.com/tj/n> ): Node.js |
267 | | - version management |
| 263 | +- [*nvm*](https://github.com/creationix/nvm) (<https://github.com/creationix/nvm>): Node.js Version Manager |
| 264 | +- [*Nave*](https://github.com/isaacs/nave) (<https://github.com/isaacs/nave>): Virtual environments for Node.js |
| 265 | +- [*n*](https://github.com/tj/n) (<https://github.com/tj/n>): Node.js version management |
268 | 266 |
|
269 | 267 | The Node.js package already includes npm—[Node Package Manager](https://npmjs.org) (<https://npmjs.org>). We'll use npm extensively to install Node.js modules. |
270 | 268 |
|
@@ -274,112 +272,77 @@ The Node.js package already includes npm—[Node Package Manager](https://npmjs. |
274 | 272 |
|
275 | 273 | ### Browser JavaScript Libraries |
276 | 274 |
|
277 | | -Front-end JavaScript libraries are downloaded and unpacked from their |
278 | | -respective web sites. Those files are usually put in the Development |
279 | | -folder (e.g., `∼/Documents/Development`) for future use. Often, there is a |
280 | | -choice between the minified production version (more on that in the AMD |
281 | | -and Require.js section of Chapter 4) and the extensively rich in |
282 | | -comments development one. |
| 275 | +Front-end JavaScript libraries are downloaded and unpacked from their respective web sites. Those files are usually put in the Development folder (e.g., `∼/Documents/Development`) for future use. Often, there is a choice between the minified production version (more on that in the AMD and Require.js section of Chapter 4) and a version that is extensively rich development comments. |
283 | 276 |
|
284 | | -Another approach is to hot-link these scripts from CDNs such as [Google |
285 | | -Hosted |
286 | | -Libraries](https://developers.google.com/speed/libraries/devguide) |
287 | | -(https://developers.google.com/speed/libraries/devguide), CDNJS |
288 | | -(http://cdnjs.com ), Microsoft Ajax Content Delivery Network |
289 | | -(<http://www.asp.net/ajaxlibrary/cdn.ashx> ), and others. By doing so |
290 | | -the apps will be faster for some users, but won’t work locally at all |
291 | | -without the Internet. |
| 277 | +Another approach is to hot-link these scripts from CDNs such as [Google Hosted Libraries](https://developers.google.com/speed/libraries/devguide) (<https://developers.google.com/speed/libraries/devguide>), CDNJS (<http://cdnjs.com>), Microsoft Ajax Content Delivery Network (<https://docs.microsoft.com/en-us/aspnet/ajax/cdn/overview>), and others. By doing so the apps will be faster for some users, but won’t work locally at all without the Internet. |
292 | 278 |
|
293 | | -- LESS as a front-end interpreter is available at |
294 | | - [lesscss.org](http://lesscss.org). You could unpack it into your |
295 | | - development folder (~/Documents/Development) or any other folder. |
| 279 | +Speaking of dependencies, I recommend downloading the following libraries that will be used in the book's project. To keep things simple, we will use just simple `.js` or `.min.js` files and not the npm packages: |
296 | 280 |
|
297 | | -- Bootstrap is a CSS/LESS framework. It's available at |
298 | | - [twitter.github.com/bootstrap](http://twitter.github.com/bootstrap). |
| 281 | +- Bootstrap is a CSS/Less framework. It's available at <https://getbootstrap.com>. |
| 282 | +- jQuery is available at <https://jquery.com>. |
| 283 | +- Backbone.js is available at <https://backbonejs.org>. |
| 284 | +- Underscore.js is available at <https://underscorejs.org>. |
| 285 | +- Require.js is available at <https://requirejs.org>. |
299 | 286 |
|
300 | | -- jQuery is available at [jquery.com](http://jquery.com). |
| 287 | +### Less App |
301 | 288 |
|
302 | | -- Backbone.js is available at [backbonejs.org](http://backbonejs.org). |
| 289 | +Less as a front-end interpreter is available at [lesscss.org](http://lesscss.org). You could unpack it into your development folder (`~/Documents/Development`) or any other folder. |
303 | 290 |
|
304 | | -- Underscore.js is available at |
305 | | - [underscorejs.org](http://underscorejs.org). |
306 | | - |
307 | | -- Require.js is available at [requirejs.org](http://requirejs.org). |
308 | | - |
309 | | -### LESS App |
310 | | - |
311 | | -The LESS App is a macOS application for "on-the-fly" compilation of |
312 | | -LESS to CSS. It's available at |
313 | | -[incident57.com/less](http://incident57.com/less). |
| 291 | +The Less App is a macOS application for "on-the-fly" compilation of Less to CSS. It's available at [incident57.com/less](http://incident57.com/less). TK |
314 | 292 |
|
315 | 293 | Cloud Setup |
316 | 294 | =========== |
317 | 295 |
|
318 | | -The Cloud setup discussed in the following sections will allow you to |
319 | | -keep your code under version control and deploy in a scalable manner. |
| 296 | +The cloud setup discussed in the following sections will allow you to keep your code under version control and deploy it in a scalable manner. |
320 | 297 |
|
321 | 298 | SSH Keys |
322 | 299 | -------- |
323 | 300 |
|
324 | | -SSH keys provide a secure connection without the need to enter user name |
325 | | -and password every time. For GitHub repositories, the latter approach is |
326 | | -used with HTTPS URLs; for example, |
327 | | -<https://github.com/azat-co/fullstack-javascript.git>; and the former with |
328 | | - |
| 301 | +For GitHub repositories, developers have to enter username and password every time with HTTPS URLs (looks like <https://github.com/azat-co/fullstack-javascript.git>), unless they use a keychain. SSH keys provide a secure connection without the need to enter a user name |
| 302 | +and password every time. The SSH URLs look like `[email protected]:azat-co/fullstack-javascript.git`. |
329 | 303 |
|
330 | | -To generate SSH keys for GitHub on macOS/UNIX machines do the |
331 | | -following: |
| 304 | +To generate SSH keys for GitHub on macOS/UNIX machines, do the following: |
332 | 305 |
|
333 | 306 | 1. Check for existing SSH keys: |
334 | 307 |
|
335 | 308 | $ cd ~/.ssh |
336 | 309 | $ ls -lah |
337 | 310 |
|
338 | | -2. If you see some files like id_rsa (please refer to Figure 2-16 for |
339 | | - an example), you could delete them or back them up into a separate |
340 | | - folder by using the following commands: |
| 311 | +2. If you see some files like `id_rsa` (please refer to Figure 2-6 for an example), you could delete them or back them up into a separate folder by using the following commands: |
341 | 312 |
|
342 | 313 | $ mkdir key_backup |
343 | 314 | $ cp id_rsa* key_backup |
344 | 315 | $ rm id_rsa* |
345 | 316 |
|
346 | | -3. Now we can generate a new SSH key pair using the ssh-keygen command, |
347 | | - assuming we are in the ~/.ssh folder: |
| 317 | +3. Now generate a new SSH key pair using the `ssh-keygen` command, assuming we are in the `~/.ssh` folder: |
348 | 318 |
|
349 | 319 | |
350 | 320 |
|
351 | | -4. Answer the questions; it is better to keep the default name |
352 | | - of id_rsa. Then copy the content of the id_rsa.pub file to your |
353 | | - clipboard (Figure 2-12): |
| 321 | +4. Answer the questions; it is better to keep the default name of `id_rsa`. Then copy the content of the `id_rsa.pub` file to your clipboard (Figure 2-6): |
354 | 322 |
|
355 | 323 | $ pbcopy < ~/.ssh/id_rsa.pub |
356 | 324 |
|
357 | 325 |  |
358 | 326 |
|
359 | | - ***Figure 2-12.** Generating RSA key for SSH and copying public key to clipboard* |
| 327 | + ***Figure 2-6.** Generating RSA key for SSH and copying public key to clipboard* |
360 | 328 |
|
361 | | -5. Alternatively, open id_rsa.pub file in the default editor: |
| 329 | +5. Alternatively, open `id_rsa.pub` file in the default editor: |
362 | 330 |
|
363 | | - `$ open id_rsa.pub` |
364 | | - |
365 | | -6. Or in TextMate: |
366 | | - |
367 | | - `$ mate id_rsa.pub` |
| 331 | + `$ edit id_rsa.pub` |
368 | 332 |
|
| 333 | + Or in VS Code (recommended): |
369 | 334 |
|
| 335 | + `$ code id_rsa.pub` |
370 | 336 |
|
371 | 337 |
|
372 | 338 | GitHub |
373 | 339 | ------ |
374 | 340 |
|
375 | | -1. After you have copied the public key, go to |
376 | | - [github.com](http://github.com), log in, go to your account |
377 | | - settings, select SSH Key, and add the new SSH key. Assign a name, |
378 | | - such as the name of your computer, and paste the value of your |
379 | | - public key. |
| 341 | +The next steps will show how to connect to GitHub (think of it as a versioned code storage) using SSH and SSH keys: |
| 342 | + |
| 343 | +1. After you have copied the public key, go to <https://github.com>, log in, go to your account settings, select SSH Key, and add the new SSH key. Assign a name, such as the name of your computer, and paste the value of your public key. |
380 | 344 |
|
381 | | -2. To check if you have an SSH connection to GitHub, type and execute |
382 | | - the following command in your terminal: |
| 345 | +2. To check if you have an SSH connection to GitHub, type and execute the following command in your terminal: |
383 | 346 |
|
384 | 347 | |
385 | 348 |
|
@@ -390,40 +353,31 @@ GitHub |
390 | 353 |
|
391 | 354 | then everything is set up. |
392 | 355 |
|
393 | | -3. The first time you connect to GitHub, you can receive an |
394 | | - Authenticity of Host … Can't Be Established warning. Please don't be |
395 | | - confused with such a message—just proceed by answering Yes as shown |
396 | | - in Figure 2-13. |
| 356 | +3. The first time you connect to GitHub, you may receive a message "Authenticity of Host … Can't Be Established warning". Please don't be alarmed with such a message. It confirms that the host you are trying to connect to is trusted. Simply proceed by answering "Yes" as shown in Figure 2-7. |
397 | 357 |
|
398 | 358 |  |
399 | 359 |
|
400 | | -***Figure 2-13.** Testing SSH connection to GitHub for the very first |
401 | | -time* |
| 360 | +***Figure 2-7.** Testing SSH connection to GitHub for the very first time* |
402 | 361 |
|
403 | | -If for some reason you have a different message, please repeat Steps 3 |
404 | | -and 4 from the previous section on SSH keys or reupload the content of |
405 | | -your \*.pub file to GitHub. |
| 362 | +If for some reason you have a different message, please repeat Steps 3 and 4 from the previous section on SSH keys or reupload the content of your `*.pub` file to GitHub. |
406 | 363 |
|
407 | 364 | Warning Keep your id_rsa file private and don't share it with anybody! |
408 | 365 |
|
409 | | -More instructions are available at GitHub: [Generating SSH |
410 | | -Keys](https://help.github.com/articles/generating-ssh-keys) |
411 | | -(<https://helpgithub.com/articles/generating-ssh-keys>). |
| 366 | +More instructions are available at GitHub: [Generating SSH Keys](https://help.github.com/articles/generating-ssh-keys) (<https://helpgithub.com/articles/generating-ssh-keys>). TK |
412 | 367 |
|
413 | | -Windows users might find the SSH key generator feature in \[PuTTY\] |
414 | | -useful. |
| 368 | +Windows users might find the SSH key generator feature in PuTTY useful. |
415 | 369 |
|
416 | | -Windows Azure |
| 370 | +Microsoft Azure |
417 | 371 | ------------- |
418 | 372 |
|
419 | | -Here are the steps to set up a Windows Azure account: |
| 373 | +Here are the steps to set up a Microsoft Azure account: |
420 | 374 |
|
421 | | -1. You'll need to sign up for Windows Azure Web Site and Virtual |
| 375 | +1. You'll need to sign up for Microsoft Azure Web Site and Virtual |
422 | 376 | Machine previews. Currently they have a 90-day free trial available |
423 | 377 | at <https://azure.microsoft.com/en-us>. |
424 | 378 |
|
425 | 379 | 2. Enable Git Deployment and create a user name and password, then |
426 | | - upload the SSH public key to Windows Azure. |
| 380 | + upload the SSH public key to Microsoft Azure. |
427 | 381 |
|
428 | 382 | 3. Install the Node.js SDK, which is available at |
429 | 383 | <https://azure.microsoft.com/en-us/develop/nodejs>. |
@@ -434,14 +388,14 @@ Here are the steps to set up a Windows Azure account: |
434 | 388 |
|
435 | 389 | You should be able to see something like this: |
436 | 390 |
|
437 | | - `Windows Azure: Microsoft's Cloud Platform... Tool Version 0.6.0` |
| 391 | + `Microsoft Azure: Microsoft's Cloud Platform... Tool Version 0.6.0` |
438 | 392 |
|
439 | | -5. Log in to Windows Azure Portal at <https://windows.azure.com> |
| 393 | +5. Log in to Microsoft Azure Portal at <https://windows.azure.com> |
440 | 394 | (Figure 2-14). |
441 | 395 |
|
442 | 396 |  |
443 | 397 |
|
444 | | - ***Figure 2-14.** Registering on Windows Azure* |
| 398 | + ***Figure 2-14.** Registering on Microsoft Azure* |
445 | 399 |
|
446 | 400 | 6. Select New, then select Web Site, and Quick Create. Type the name |
447 | 401 | that will serve as the URL for your web site, and click OK. |
@@ -462,14 +416,14 @@ Here are the steps to set up a Windows Azure account: |
462 | 416 |
|
463 | 417 | 9. Advanced user option: Follow this tutorial to create a virtual |
464 | 418 | machine and install MongoDB on it: [Install MongoDB on a virtual |
465 | | - machine running CentOS Linux in Windows Azure](https://www.windowsazure.com/en-us/manage/linux/common-tasks/mongodb-on-a-linux-vm) (https://www.windowsazure.com/en-us/manage/linux/common-tasks/mongodb-on-a-linux-vm). |
| 419 | + machine running CentOS Linux in Microsoft Azure](https://www.windowsazure.com/en-us/manage/linux/common-tasks/mongodb-on-a-linux-vm) (https://www.windowsazure.com/en-us/manage/linux/common-tasks/mongodb-on-a-linux-vm). |
466 | 420 |
|
467 | 421 |
|
468 | 422 | Heroku |
469 | 423 | ------ |
470 | 424 |
|
471 | 425 | Heroku is a polyglot agile application deployment platform (see |
472 | | -<http://www.heroku.com>). Heroku works similarly to Windows Azure in |
| 426 | +<http://www.heroku.com>). Heroku works similarly to Microsoft Azure in |
473 | 427 | the sense that you can use Git to deploy applications. There is no need |
474 | 428 | to install Virtual Machine for MongoDB because [Heroku has a MongoHQ |
475 | 429 | add-on](https://addons.heroku.com/mongohq) |
|