随笔分类 -  nodejs

摘要:1.连接URL (使用数据用户名与密码连接或不使用连接数据库) npm install mongodb --save var mon = require('mongodb').MongoClient; //引入mongo node驱动 var con_url = 'mongodb://localho 阅读全文
posted @ 2017-04-10 09:42 wifix 阅读(326) 评论(0) 推荐(0)
摘要:1.下载mongodb社区版: windows 安装包安装: https://www.mongodb.com/download-center#community(mongo下载中心) 配置环境变量 控制面板 ->系统->高级系统设置->环境变量->系统变量path 追加 C:\Program Fil 阅读全文
posted @ 2016-12-12 15:06 wifix 阅读(2356) 评论(0) 推荐(0)
摘要://打开数据库var db = new sqlite3.Database('xx.db');// 关闭数据库db.close();db.run('xx'); // 数据库对象的run函数可以执行任何的SQL语句,该函数一般不用来执行查询 // create alter 之类的增:var stmt = 阅读全文
posted @ 2016-08-02 18:01 wifix 阅读(6279) 评论(0) 推荐(0)
摘要:npm install -g http-server 以后可以在任何一个文件夹启动静态文件的访问通过http-server -a localhost -p 8000ctrl + c结束 http-server -h npm 仓库地址: https://www.npmjs.com/package/ht 阅读全文
posted @ 2016-04-10 22:08 wifix 阅读(1865) 评论(0) 推荐(0)