2014年1月22日

Node.js连接postgres

摘要: 一、下载Node.js postgres驱动 Node.js里面没有postgres模块的,我们需要安装node-postgres模块。 node-postgres模块的下载地址为:https://github.com/brianc/node-postgres。下载完成后,解压到pg目录,pg里面的文件目录结构如下图所示:二、编写js代码1、在D盘新建文本文件重命名为,test-postgres.js。内容如下: 1 var pg = require('./pg'); //加载模块node-postgres,该模块要与本文件放于同一个目录下 2 var conString = 阅读全文

posted @ 2014-01-22 14:27 烟火_ 阅读(6169) 评论(1) 推荐(1) 编辑

导航