BestDivision Logo

How to create server using only Node JS without using any third party Libraries?

BestDivision
BestDivision  @bestdivision
Created At - 2020-08-02
Last Updated - 2024-08-28

Table of Contents

  • Creating Server Using Only NodeJS:-
    • Creating your first real application:-
    • Creating your first real application with different Routes in URL:-

Creating Server Using Only NodeJS:-

Creating your first real application:-

STEPS:-

  1. Create:- index.html
  2. Create:- server.js
  3. Run:- node server.js

index.html

server.js

Now both files are created and ready to go. Now go to your command prompt and navigate to the file and run the command node server.js

**NOTE:- ** In the above file server.js,  Content-Type: text/html.

Creating your first real application with different Routes in URL:-

This was just to show that we can create our app by just using NodeJS. But in real life for routing this way will be much more complex as the number of URL increases for our site. Thus, we use ExpressJS library to handle this URL routing. That we will come to know in our next blog.

Share

‌

  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌
  • ‌

    ‌
    ‌

    ‌

    ‌