We're going to start by crawling, to appreciate what the web frameworks are doing for us. Crawling means starting with Node's core package, the HTTP Server object.

The Math Wizard, like any web application, has multiple pages, each with its own URL. Each page has a few common elements (the general page structure and the navigation bar) and per-page content unique to each page. In the Math Wizard the URLs are as follows:

`/`

: For the wizard's home page`/square`

: To calculate the square of a number`/mult`

: To multiply two numbers`/factorial`

: To calculate the factorial of a number`/fibonacci`

: To calculate fibonacci numbers

To get started create a directory to hold the source code:

**$ mkdir chap04**

Start Free Trial

No credit card required