03 2014 档案

摘要:首先安装async包用到的有http、cluster包http和cluster都会node自带的包,无需安装1:创建cluster.js,代码如下,更具cpu创建多个进程var cluster = require("cluster");var http = require("http");var n... 阅读全文
posted @ 2014-03-27 16:55 ajunfly 阅读(3824) 评论(0) 推荐(1)
摘要:下载nginx-1.0.11.zip,解压到到nginx目录下 D:\nginx\conf修改conf下的nginx.conf文件,默认是80端口,若该端口被占则可以修改listen 8073;运行nginx下的nginx.exe,此时运行进程中会多两个nginx服务nginx安装完成NginxTray 1.0是管理nginx服务的,可以停止、重启、启动下载NginxTray 1.0,解压后,执行NginxTray.exe即可nginx的反向代理负载均衡配置打开nginx.conf添加如下配置upstream Server_Cluster{ server 127.0.0.1:30001; se 阅读全文
posted @ 2014-03-22 16:51 ajunfly 阅读(309) 评论(0) 推荐(0)
摘要:用到两个模块,http和fsvar http = require("http");var fs = require("fs");var server = http.createServer(function(req, res){}).listen(50082);console.log("http start");var url = "http://s0.hao123img.com/res/img/logo/logonew.png";http.get(url, function(res){ var imgData = 阅读全文
posted @ 2014-03-04 17:47 ajunfly 阅读(22603) 评论(0) 推荐(6)
摘要://时间戳转换成指定格式的日期DateTool.IntDatetimeTo = function(time, format){ var testDate = new Date(time); var o = { "M+" : testDate.getMonth()+1, "d+" : testDate.getDate(), "h+" : testDate.getHours(), "m+" : testDate.getMinutes(), "s+" : testDate.getSeconds(), 阅读全文
posted @ 2014-03-03 11:36 ajunfly 阅读(2111) 评论(0) 推荐(0)