随笔分类 -  NodeJS

linux 下部署nodejs(两种方式)
摘要:本次博客的编写时用的系统环境,刚装好的Centos 6.4 64位虚拟机。另外关于linux 其他系统的安装 可以参考https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager之前在linux下部署过几次NodeJS,也有些经验,最近也在Q群里有朋友问Node在linux下部署问题,于是总结一下,主要介绍两种不同的部署方式,二进制文件直接解压部署和手动编译安装,一来巩固自己的知识,二来希望能对新手有所帮助。关于在node在linux的部署我认为主要有三种方式,第一种就是自己下载源码,手动编译二进制,即是部 阅读全文

posted @ 2014-02-21 10:02 dubaokun 阅读(82766) 评论(11) 推荐(4)

设置express ejs模板的后缀名html
摘要:如果使用jade或者ejs模板引擎的话 模板文件的格式为ejs或者jade ,有时候需要将后缀名修改为 html格式的。app.set('view engine','ejs'); app.engine('.html',require('ejs').__express);或者app.engine('html', require('ejs').renderFile);同时route中的代码 也要加上后缀比如 exports.index = function(req, res){ res.render(& 阅读全文

posted @ 2013-11-27 17:22 dubaokun 阅读(1353) 评论(0) 推荐(0)

Grunt 常用插件
摘要:1、grunt-contrib-jshint javascript代码检查(并会给出建议)https://github.com/gruntjs/grunt-contrib-jshint2、grunt-contrib-concat 合并JS文件 https://github.com/gruntjs/grunt-contrib-concat3、grunt-contrib-uglify 压缩jshttps://github.com/gruntjs/grunt-contrib-uglify4、grunt-contrib-less 将less编译为CSShttps://github.com/gruntj 阅读全文

posted @ 2013-11-20 16:30 dubaokun 阅读(306) 评论(0) 推荐(0)

Getting Started with Node.js on Heroku
摘要:NodeJS应用托管平台https://devcenter.heroku.com/articles/getting-started-with-nodejs#dyno-sleeping-and-scalinghttp://www.clovery.org/use-heroku-deploy-nodejs-application.htmlhttp://www.gmarwaha.com/blog/2011/05/18/heroku-trouble-with-windows-and-ssh-keys/ 创建ssh-key在heroku中使用WebSocket https://devcenter.hero 阅读全文

posted @ 2013-11-11 23:29 dubaokun 阅读(240) 评论(0) 推荐(0)

使用jasmine-node 进行NodeJs单元测试 环境搭建
摘要:关于jasmine就不多说了,关于语法请参加官方文档。http://pivotal.github.io/jasmine/关于NodeJS的单元测试框架有多种,如果要在NodeJS中使用jasmine的话 ,需要安装jasmine-node. 采用npm安装即可。github地址https://github.com/mhevery/jasmine-node全局安装 jasmine-node 。 npm install jasmine-node -g 安装完之后环境基本也算是搭建好了。下面写个Demo。编写我们NodeJS的功能js代码 。新建一个目录 test 新建我们要编写的js功能文件Bub 阅读全文

posted @ 2013-10-31 10:38 dubaokun 阅读(2570) 评论(1) 推荐(0)

Karma和Jasmine 自动化单元测试环境搭建
摘要:最近初学AngularJS ,看到的一些教程中经常有人推荐使用Karma+Jasmine来进行单元测试。自己之前也对Jasmine有些了解,jasmine也是一个不错的测试框架。1、 karma介绍Karma是Testacular的新名字,在2012年google开源了Testacular,2013年Testacular改名为Karma。Karma是一个基于Node.js的JavaScript测试执行过程管理工具(Test Runner)。该工具可用于测试所有主流Web浏览器,也可集成到CI(Continuous integration)工具,也可和其他代码编辑器一起使用。这个测试工具的一个强 阅读全文

posted @ 2013-10-30 17:04 dubaokun 阅读(3383) 评论(1) 推荐(0)

npm使用【转】
摘要:NPM是一个Node包管理和分发工具,已经成为了非官方的发布Node模块(包)的标准。有了NPM,可以很快的找到特定服务要使用的包,进行下载、安装以及管理已经安装的包。在安装nodeJS 安装包的时候的时候npm会自动安装 ,如果我们下载的是 node.exe的可执行程序,那么我们需要单独安装npm. 1 下载npm源代码: https://github.com/isaacs/npm/tags2. 将npm源代码解压到D:\npmjs目录中。 在命令提示符窗口中执行下面的操作,完成npm的安装:D:\>cd npmjsD:\npmjs>node cli.js install -gf 阅读全文

posted @ 2013-10-29 22:57 dubaokun 阅读(632) 评论(0) 推荐(0)

导航

新浪微博 新博客 Github