Share icon
nodejs with xampp

Hello Guys,

We can easily connect the Nodejs with xampp by follow simple steps -

Nodejs required a specfic port to run on system and defaluts port is 8080, So let's starts

  • Download Nodejs form its website ,If node is installed successfully then open terminal or Git  Bash to check 
    Run command : node -v and npm -v it gives node version ,If it shows then you installed the node successfully.
  • Install It whole package, After then make folder in any drive with any name let's I take node_code in c drive so my path is :
    c:/node_code
  • Now Install Xampp (If not installed )download.html, and run Apache , If no error on, then we are almost done.
  • Now create a .js file in node_code folder let name that first_node.js and the below code :
    var http = require('http');http.createServer(function (req,res){ res.write('Nodejs started using xampp'); res.end();}).listen(8080);
    console.log('http server started'); 
  • Now open Git Bash or Command prompt on which you run the node -v command and navigate to the node_code folder by cd command
  • Now use Command 
    node first_node.js
  • after run this command you will see  "http server started" appear on command prompt.
  • Now Open any browser you have run localhost:8080 you will appear a writemessage.
    "Nodejs started using xampp"
  • That it, Nodejs connected with Xampp. By using same concept you will connect your server to Nodejs and run Nodejs on your website.

Thanks

Comments

Profile picture for user Duan Camargo
Anonymous (not verified)
Sat, 02/20/2021 - 11:56
Profile picture for user Duan Camargo
Anonymous (not verified)
Sat, 02/20/2021 - 11:57
Profile picture for user Duan Camargo
श्री विठ्ठल दश… (not verified)
Fri, 10/08/2021 - 19:30
Profile picture for user Duan Camargo
Anonymous (not verified)
Sun, 07/11/2021 - 08:39
Profile picture for user Duan Camargo
Michael (not verified)
Wed, 08/11/2021 - 16:56
Profile picture for user Duan Camargo
Miroslav (not verified)
Sat, 08/14/2021 - 20:35

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.