Monday, June 2, 2014

Connect MongoDB with nodeJS


In following example will explain the how to make connection nodeJS with mongodb.
  • create directory connectdb
  • first create package.json file inside the connectdb directory and add following content. then cd to connectdb directory and install dependancy by using npm install command
  • In this file contains dependency modules. 
  • cd to connectdb directory and enter following command then dependency modules will be installed 
       npm install 
  • Then create server.js/ app.js file.To run nodejs application run this server.js file. This is the entry point for the application.

Create car module
Create routes/cars.js file. This contains car related code.
  You can get code from following link
 https://github.com/cchathura/cmeanstack.git/branches/connectdb

Tuesday, March 25, 2014

Reset Ubuntu Network interface ethX to eth0

 Reset Ubuntu Network interface ethX to eth0


clear the content of following file 

/etc/udev/rules.d/70-persistent-net.rules

Then Restart the System. :)