天天看点

在CentOS5.6上安装Node.js(续)——编写程序验证安装

        1. 使用安装mongodb驱动

根据提示执行:

   注意:驱动必须安装在项目所在的目录下,并不是安装一次所有项目都可以使用。

2. 编写测试代码mongo.js

启动服务器:

在浏览器访问http://127.0.0.1:3000,可以看到如下输出:

在CentOS5.6上安装Node.js(续)——编写程序验证安装

现在可以说前面的安装过程是正确,开了个好头。

参考文章:

<a href="http://blog.mongodb.org/post/6587009156/cloudfoundry-mongodb-and-nodejs" target="_blank">Getting started with VMWare CloudFoundry, MongoDB and Node.js</a>

<a href="http://howtonode.org/express-mongodb" target="_blank">Blog rolling with mongoDB, express and Node.js</a>