一棵树

路漫漫其修远兮 吾将上下而求索。

导航

文章分类 -  Node.js

Manage session using Node.js and Express 4
摘要:1:第一步:安装"express-session": "~1.7.6"2:在app.js增加varsession=require('express-session');app.use(session({secret: 'ssshhhhh'}));app.use(function(req, res, ... 阅读全文

posted @ 2014-12-12 16:28 nxp 阅读(190) 评论(0) 推荐(0)

Node.js 包教不包会》 -- by alsotang
摘要:https://github.com/alsotang/node-lessons/tree/master/lesson2《学习使用外部模块》$ npm install express utility --save 这样可以把包保存在package.json中// 引入依赖var express = ... 阅读全文

posted @ 2014-12-08 17:58 nxp 阅读(1009) 评论(0) 推荐(0)

node.js 遇到问题解决和总结
摘要:1:怎样用layout.ejs在package.json里面的dependencies添加"express-partials": “*” 然后运行cmd并切换至项目目录运行npm install获得最新版。 app.js里面引用express-partials: 1 添加引用var partials... 阅读全文

posted @ 2014-12-05 11:35 nxp 阅读(109) 评论(0) 推荐(0)

node.js开发指南读后感
摘要:1:$ npm install -g supervisor修改代码时不必总是重启服务,可以在浏览器刷新看到修改后的改变。用这个启动:$ supervisor app.js 或者supervisor ./bin/www2:创建和加载模块2.1:创建模块--一个文件就是一个模块//getmodule.j... 阅读全文

posted @ 2014-12-04 18:32 nxp 阅读(110) 评论(0) 推荐(0)

node.js express 安装
摘要:1:安装1:npm install express -g 如果不行 sudo npm install express -g2:npm install -g express-generator2:创建一个文件夹e:\cd mypro e:\mypro >express demo3:E:\mypro>e... 阅读全文

posted @ 2014-11-29 23:30 nxp 阅读(139) 评论(0) 推荐(0)

node stream
摘要:stream-handbookThis document covers the basics of how to write node.js programs with streams.You also could read a chinese editioncc-by-3.0node packag... 阅读全文

posted @ 2014-11-29 23:27 nxp 阅读(132) 评论(0) 推荐(0)

Node.js Style Guide 编码规范
摘要:1:用单引号正确:var foo = 'bar'; 错误:var foo = “bar”;2:Your opening braces go on the same line as the statement.正确:if (true) { console.log('winning');}错误:if ... 阅读全文

posted @ 2014-11-29 23:06 nxp 阅读(109) 评论(0) 推荐(0)

nodejs入门
摘要:Felix's Node.js Beginners GuideThis simple web server written in Node responds with "Hello World" for every request.var http = require('http');http.cr... 阅读全文

posted @ 2014-11-27 12:20 nxp 阅读(111) 评论(0) 推荐(0)

被误解的 Node.js
摘要:摘自王 群锋, 软件工程师, IBM http://www.ibm.com/developerworks/cn/web/1201_wangqf_nodejs/被误解的 Node.js如果经常浏览各大技术网站,那么你会发现自己很难错过 Node.js,程序员们兴奋地说:JavaScript 也可以开发... 阅读全文

posted @ 2014-11-24 11:02 nxp 阅读(98) 评论(0) 推荐(0)

Node.js 究竟是什么?
摘要:摘自Michael Abernethy, 自由程序员, Freelancer http://www.ibm.com/developerworks/cn/opensource/os-nodejs/一个 “编码就绪” 服务器Node 是一个服务器端 JavaScript 解释器,它将改变服务器应该如何工... 阅读全文

posted @ 2014-11-24 10:41 nxp 阅读(121) 评论(0) 推荐(0)