In this exercise we create a simple HTTP server which is running on localhost and demonstrates basic URL parsing and routing.
npm install http
npm install url
npm install fs
First clone the repository:
git clone git@github.com:angrbrd/favorites-server.git
Then run the server with the steps below:
cd favorites-server
node favorites-server.js
You will see the following output on your console:
Favorites server is now listening on http://localhost:8080
Open your browser and point it to localhost:8080 to see the available links and click on them to observe the routing based on URL. If an unknown URL is entered, a 404 landing page is returned.