随笔分类 -  nodejs

Nodejs创建客户端
摘要:Node 创建 Web 客户端需要引入 http 模块,创建 client.js 文件,代码如下所示:var http = require('http');//用于请求的选项var options = { host:'localhost', port:'8000', path:'/index.htm... 阅读全文
posted @ 2015-12-29 14:19 asker7 阅读(979) 评论(0) 推荐(0)
NodeJs 创建 Web 服务器
摘要:以下是演示一个最基本的 HTTP 服务器架构(使用8081端口),创建 ser.js 文件,代码如下所示:var http = require('http');var fs = require('fs');var url = require('url');//创建服务器server = http.c... 阅读全文
posted @ 2015-12-29 11:26 asker7 阅读(222) 评论(0) 推荐(0)
nodejs下mysql读取数据库
摘要:初次接触nodejs和mysql的使用写下来记录一下数据库为test,表为user,结构如下建立my.js文件var mysql = require('mysql')var connection = mysql.createConnection({ host:'localhost', user:'r... 阅读全文
posted @ 2015-11-27 16:27 asker7
第一次接触Nodejs
摘要:安装后,直接在命令提示符下运行cd进入安装目录在安装目录下建立hello.js文件,运行方法为用浏览器打开http://127.0.0.1:1337/ 阅读全文
posted @ 2015-11-26 09:34 asker7


asker7