Simple web server using nodejs

We can make a folder just like a web server using nodejs for quick jobs

First we can install connect and expressjs, serve-static with Node.js:

$ npm install connect serve-static

We can make .js file (serve.js) and write the below code in that file:

var connect = require('connect');
var serveStatic = require('serve-static');

Then in cmd, run this file:

$ node server.js

Now we can access the local server in URL:


And can exit by pressing:


 7,647 total views,  2 views today

1 Comment

  1. great put up, very informative. I ponder why the other specialists of this sector don’t understand this.
    You should continue your writing. I’m confident, you’ve a great
    readers’ base already!

Leave a Reply

Your email address will not be published.