利用nodejs搭建服务器,并连接PostgreSQL数据库,利用前端传过来的中心点坐标和搜索半径,进行空间查询,实现简单的搜周边,下面是实现流程和nodejs的代码:app.post('/tosearcharound', multipartMiddleware, function (req, re...
分类:
Web程序 时间:
2015-06-21 23:39:44
阅读次数:
321
写在前面:本文中所有测试实例皆基于mac版chrome, firefox及safari。 同步请求 同步请求,其实也就是告诉js引擎:你先把我这个处理了再做别的事情!所以同步无需等,在send()之后直接往responseText中拿数据就好。 function req() { var xhr = ...
分类:
Web程序 时间:
2015-06-21 22:16:53
阅读次数:
256
VCL Examples Manipulating request headers in VCL 在VCL中操作请求的header。 当我们想移除发送到web服务器/images目录的所有对象的cookie可以这样: sub?vcl_recv?{
????if?(req.url?~?"^/images")?...
分类:
其他好文 时间:
2015-06-19 20:22:54
阅读次数:
203
var?http?=?require(‘http‘);
http.createServer(function?(req,?res)?{
??console.log(req.url);
??console.log(req.method);
??console.log(‘-------------------------------------------‘);
??...
分类:
Web程序 时间:
2015-06-19 16:59:31
阅读次数:
116
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sb.ToString()); WebResponse rep = req.GetResponse(); StreamReader...
分类:
Web程序 时间:
2015-06-19 11:44:47
阅读次数:
98
今天在学习less的时候发现了在node中是可以渲染的,通过调用less的render方法渲染来生成css,所以写了个小Demo。var less = require('less');var http = require('http');http.createServer(function(req,...
分类:
其他好文 时间:
2015-06-17 19:46:42
阅读次数:
125
restfull路由如下:router.get('/:id', controller.show);mongoes代码如下:exports.show = function(req, res) { Notice.findById(req.params.id, function (err, notice....
分类:
其他好文 时间:
2015-06-17 16:35:08
阅读次数:
204
private String uploadFile(HttpServletRequest req,String file_name){ try { MultipartHttpServletRequest multipartRequest = (MultipartH...
分类:
编程语言 时间:
2015-06-17 11:25:04
阅读次数:
131
Request and response VCL objects VCL中有些需要你注意的重要对象。这些对象可以在VCL被使用和操作。 req
The?request?object.?When?Varnish?has?received?the?request?the?req?object?is?created...
分类:
其他好文 时间:
2015-06-16 13:12:01
阅读次数:
193
术语说明:QPS = req/sec = 请求数/秒【QPS计算PV和机器的方式】QPS统计方式 [一般使用 http_load 进行统计]QPS = 总请求数 / ( 进程总数 * 请求时间 )QPS: 单个进程每秒请求服务器的成功次数单台服务器每天PV计算公式1:每天总PV = QPS * 36...
分类:
其他好文 时间:
2015-06-15 20:15:21
阅读次数:
112