GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — add changes :laughing: · D-Mbithi/fullstack-javascript@2d5c71f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • chapter6
    • chapter6.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎chapter6/chapter6.md‎

Copy file name to clipboardExpand all lines: chapter6/chapter6.md
+21-45Lines changed: 21 additions & 45 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,12 @@ Get the version 8 or higher. If you don't have Node.js installed, or if your ver
3535
You can use one of these tools for version management (i.e., switching
3636
between Node.js versions):
3737

38-
- [n](https://github.com/tj/n) (<https://github.com/tj/n>)
38+
- `n`: <https://npmjs.com/n>
39+
- `nave`: <https://npmjs.com/nave>
40+
- `nvm`: <https://npmjs.com/nvm>
41+
- `nvm-windows`: <https://github.com/coreybutler/nvm-windows>
3942

40-
- [nave](https://github.com/isaacs/nave) (<https://github.com/isaacs/nave>)
41-
42-
- [nvm](https://github.com/creationix/nvm) (<https://github.com/creationix/nvm>)
43-
44-
As usual, you could copy the example code at
45-
https://github.com/azat-co/fullstack-javascript/tree/master/code/06-hello, TK or
46-
write your own program from scratch. If you wish to do the latter,
47-
create a folder `hello` for your "Hello World" Node.js application. Then
48-
create a file `server.js` and line by line type the code below.
43+
As usual, you could copy the example code at <http://bit.ly/2Lbvxzr>, or write your own program from scratch. If you wish to do the latter, create a folder `hello` for your "Hello World" Node.js application. Then create a file `server.js` and line by line type the code below.
4944

5045
This line will load the core `http` module for the server (more on the
5146
modules later):
@@ -129,8 +124,6 @@ the main methods:
129124
- `http.createServer()`: Returns a new web server object
130125
- `http.listen()`: Begins accepting connections on the specified
131126
port and hostname
132-
- `http.createClient()`: Node.js app can be a client and make requests
133-
to other servers TK
134127
- `http.ServerRequest()`: Passes incoming requests to request
135128
handlers
136129
- `data`: Emitted when a piece of the message body is received
@@ -336,15 +329,12 @@ To push changes, just execute:
336329
$ git commit -m "changing to hello azure"
337330
$ git push azure master
338331

339-
A more meticulous guide can be found in the tutorial <https://docs.microsoft.com/en-us/azure/app-service/app-service-web-get-started-nodejs>. TK
332+
A more meticulous guide can be found in the tutorial <http://bit.ly/2LbXQOi>.
340333

341334
Deploying to Heroku
342335
===================
343336

344-
For Heroku deployment, we need to create two extra files: `Procfile` and
345-
`package.json`. You could get the source code from
346-
<https://github.com/azat-co/fullstack-javascript/tree/master/code/06-hello> TK or
347-
write your own one.
337+
For Heroku deployment, we need to create two extra files: `Procfile` and `package.json`. You could get the source code from <http://bit.ly/2Lbvxzr> or write your own one.
348338

349339
The structure of the "Hello World" application looks like this:
350340

@@ -713,40 +703,26 @@ frameworks like Express.js or Restify but there are many powerful and useful fra
713703
- [Restify](http://mcavage.github.com/node-restify) (<http://restify.com>): Lightweight framework for REST API servers
714704
- [Sails](http://sailsjs.org) (<http://sailsjs.org>): MVC Node.js framework with rich scaffolding
715705
- [hapi](https://hapijs.com) (<https://hapijs.com>): Node.js framework built on top of Express.js
716-
- [Connect](http://www.senchalabs.org/connect) (<https://github.com/senchalabs/connect#readme>): a middleware framework for Node.js, shipping with over 18 bundled middlewares and a rich selection of third-party middleware
717-
- [GeddyJS](http://geddyjs.org) (<http://geddyjs.org>): a simple, structured MVC web framework for Node
718-
- [CompoundJS](http://compoundjs.com) (<http://compoundjs.com>) (ex-RailswayJS): Node.JS MVC framework based on ExpressJS
719-
- [Tower.js](http://towerjs.org) (<http://tower.github.io>): a full stack web framework for Node.js and the browser
720-
- [Meteor](http://meteor.com) (<https://www.meteor.com>): open-source platform for building top-quality web apps in a fraction of the time
706+
- [Connect](http://www.senchalabs.org/connect) (<https://github.com/senchalabs/connect>): Middleware framework for Node.js, shipping with over 18 bundled middlewares and a rich selection of third-party middleware
707+
- [GeddyJS](http://geddyjs.org) (<http://geddyjs.org>): Simple, structured MVC web framework for Node
708+
- [CompoundJS](http://compoundjs.com) (<http://compoundjs.com>) (ex-RailswayJS): Node.js MVC framework based on Express.js
709+
- [Tower.js](http://towerjs.org) (<http://tower.github.io>): Full stack web framework for Node.js and the browser
710+
- [Meteor](http://meteor.com) (<https://www.meteor.com>): Open-source platform for building top-quality web apps in a fraction of the time
721711

722-
For a list of hand-picked frameworks, take a look at
723-
(<http://nodeframeworks.com>). Ways to improve the application:
712+
For a list of hand-picked Node.js frameworks, take a look at <http://nodeframeworks.com>.
724713

725-
- Improve existing test cases by adding object comparison instead of a
726-
string one
714+
Next, I will explain a few ways to improve the REST API application. These are your assignments to give you more practice and make the learning more effective:
727715

716+
- Improve existing test cases by adding object comparison instead of a string one
728717
- Move the seed data to `test.js` from `mb-server.js`
718+
- Add test cases to support your frontend (e.g., up vote, user login)
719+
- Add methods to support your frontend (e.g., up-vote, user login)
720+
- Generate unique IDs for each message and store them in a Hash instead of an Array
721+
- Install Mocha and re-factor `test.js` so it uses this library
729722

730-
- Add test cases to support your front-end (e.g., up-vote, user
731-
log in)
732-
733-
- Add methods to support your front-end (e.g., up-vote, user log in)
734-
735-
- Generate unique IDs for each message and store them in a Hash
736-
instead of an Array
737-
738-
- Install Mocha and re-factor test.js so it uses this library
739-
740-
So far we've been storing our messages in the application memory, so
741-
each time the application is restarted, we lose it. To fix it, we need
742-
to add a persistence, and one of the ways is to use a database like
743-
MongoDB.
723+
So far we've been storing our messages in the application memory, so each time the application is restarted, we lose our messages. To fix it, we need to add persistence (more permanent store), and one of the best ways is to use a database like MongoDB, introduced in the next chapter.
744724

745725
Summary
746726
-------
747727

748-
In this chapter we've covered important topics that will lay the
749-
foundation. They exhibit the "Hello World" application in Node.js, list
750-
of some of its most important core modules, npm workflow, detailed
751-
commands for deployment of Node.js apps to Heroku and Microsoft Azure; and
752-
an example of a test-driven development practice.
728+
In this chapter we've covered important topics that will lay the foundation for all of your future Node.js development. This chapter taught the "Hello World" application in Node.js, listed of some of its most important Node.js core modules, explained the npm workflow, covered test-driven development practice, and provided detailed commands for deployment of Node.js apps to the Heroku and Microsoft Azure cloud services.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.