@@ -314,20 +314,26 @@ Deploying to Microsoft Azure |
314 | 314 |
|
315 | 315 | In order to deploy our "Hello World" application to Microsoft Azure, we must add a Git remote destination that belongs to Azure. You could copy the URI/URL from the Microsoft Azure Portal, and use it with this command: |
316 | 316 |
|
317 | | - $ git remote add azure YOUR_AZURE_URI |
| 317 | +``` |
| 318 | +$ git remote add azure YOUR_AZURE_URI |
| 319 | +``` |
318 | 320 |
|
319 | 321 | Now we should be able to make a push with this command: |
320 | 322 |
|
321 | | - $ git push azure master |
| 323 | +``` |
| 324 | +$ git push azure master |
| 325 | +``` |
322 | 326 |
|
323 | 327 | If everything went okay, you should see success logs in the terminal and |
324 | 328 | "Hello World" in the browser of your Microsoft Azure Web Site URL. |
325 | 329 |
|
326 | 330 | To push changes, just execute: |
327 | 331 |
|
328 | | - $ git add . |
329 | | - $ git commit -m "changing to hello azure" |
330 | | - $ git push azure master |
| 332 | +``` |
| 333 | +$ git add . |
| 334 | +$ git commit -m "changing to hello azure" |
| 335 | +$ git push azure master |
| 336 | +``` |
331 | 337 |
|
332 | 338 | A more meticulous guide can be found in the tutorial <http://bit.ly/2LbXQOi>. |
333 | 339 |
|
@@ -338,10 +344,12 @@ For Heroku deployment, we need to create two extra files: `Procfile` and `packag |
338 | 344 |
|
339 | 345 | The structure of the "Hello World" application looks like this: |
340 | 346 |
|
341 | | - /06-hello |
342 | | - -package.json |
343 | | - -Procfile |
344 | | - -server.js |
| 347 | +``` |
| 348 | +/06-hello |
| 349 | + -package.json |
| 350 | + -Procfile |
| 351 | + -server.js |
| 352 | +``` |
345 | 353 |
|
346 | 354 | `Procfile` is a mechanism for declaring what commands are run by your |
347 | 355 | application’s dynos on the Heroku platform. Basically, it tells Heroku |
@@ -403,19 +411,21 @@ We'll start by creating an empty `mb-server.js` file. After it's there, |
403 | 411 | let's switch to tests and create the `test.js` file with the following |
404 | 412 | content: |
405 | 413 |
|
406 | | - const http = require('http') |
407 | | - const assert = require('assert') |
408 | | - const querystring = require('querystring') |
409 | | - const util = require('util') |
410 | | - |
411 | | - const messageBoard = require('./mb-server') |
412 | | - |
413 | | - assert.deepEqual('[{"name":"John","message":"hi"}]', |
414 | | - messageBoard.getMessages()) |
415 | | - assert.deepEqual ('{"name":"Jake","message":"gogo"}', |
416 | | - messageBoard.addMessage ("name=Jake&message=gogo")) |
417 | | - assert.deepEqual('[{"name":"John","message":"hi"},{"name":"Jake","message":"gogo"}]', |
418 | | - messageBoard.getMessages()) |
| 414 | +```js |
| 415 | +const http = require('http') |
| 416 | +const assert = require('assert') |
| 417 | +const querystring = require('querystring') |
| 418 | +const util = require('util') |
| 419 | + |
| 420 | +const messageBoard = require('./mb-server') |
| 421 | + |
| 422 | +assert.deepEqual('[{"name":"John","message":"hi"}]', |
| 423 | + messageBoard.getMessages()) |
| 424 | +assert.deepEqual ('{"name":"Jake","message":"gogo"}', |
| 425 | + messageBoard.addMessage ("name=Jake&message=gogo")) |
| 426 | +assert.deepEqual('[{"name":"John","message":"hi"},{"name":"Jake","message":"gogo"}]', |
| 427 | + messageBoard.getMessages()) |
| 428 | +``` |
419 | 429 |
|
420 | 430 | Please keep in mind that this is a very simplified comparison of strings |
421 | 431 | and not JavaScript objects. So every space, quote, and case matters. You |
|