- 博客(3)
- 收藏
- 关注
原创 NodeJS事件的使用
NodeJS的事件交给 EventEmitter 完成用法如下var EventEmitter = require('events').EventEmitter; var event = new EventEmitter(); event.on('eventname', function () { console.log("触发了事件"); });setTimeout(function ()
2015-03-11 19:00:39
230
原创 Express相关问题集合
Express安装后出现command not found问题安装Node.js框架Express:npm install -g express,后 使express –help,出现提示:sh: express: command not found。明明安装了express,但却告知不能命令运行express。解决方法如下: 在安装express时增加generator参数: sudo
2015-03-11 18:57:02
258
原创 使用 HTTP服务
使用 HTTP服务新建 server.js 写入如下代码var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(7081);在
2015-03-11 13:04:28
212
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人