On this tutorial i will show you how Node.js can respond a requesition based on URL.
For this we will consider a computer store with the following categories:
After we create the file above we name it as “index.js” then on the Node.js command prompt we execute the following command:
The next step is open a browser and type the URL address to obtain its content.
To access the laptops category :
To access the smartphones category :
To accessthe smartphones tablets: