NodeJS Introduction

Node Components

NodeJS has following 3 components which takes the platform to up and running:

  1. Importing required modules using require directory
  2. Creating server
  3. Read request and return response.

Following is the code snippet showing use of above components:

Components Use-Case

Workflow explanation of above snippet components:

Above Code shows that we have imported http directory using require module and stored in a variable. Then we have called method ceatreServer() on http instance with request and response as arguments to it.

To test its working visit localhost:1234 in your web-browser.

Published by

Unknown's avatar

sevanand yadav

software engineer working as web developer having specialization in spring MVC with mysql,hibernate

Leave a comment