内容简介:hi-nginx-1.4.8正式发布。 更新: nginx升级至1.14.0 升级hi-project脚本,创建工程更灵活方便 支持java 10 添加hi_lua_package_path 和 hi_lua_package_cpath 命令. 添加三个缓存控制命令:hi_need_kvdb,hi_kv...
hi-nginx-1.4.8正式发布。
更新:
nginx升级至1.14.0
升级hi-project脚本,创建工程更灵活方便
支持 java 10
添加hi_lua_package_path 和 hi_lua_package_cpath 命令.
添加三个缓存控制命令:hi_need_kvdb,hi_kvdb_size,hi_kvdb_expires
php例子:
require_once 'hi/servlet.php';
require_once 'hi/route.php';
class index implements \hi\servlet {
public function handler(\hi\request $req, \hi\response $res) {
$app = \hi\route::get_instance();
$app->add('{^/$}', array('GET'), function ($rq, $rs, &$param) {
$rs->content = 'hello,world';
$rs->status = 200;
});
$app->add('{^/who/(?P<name>\w+)/?$}', array('GET'), function ($rq, $rs, &$param) {
$rs->content = 'hello,'.$param['name'];
$rs->status = 200;
});
$app->add('{^/phpinfo/?$}', array('GET'), function($rq, $rs, &$param) {
ob_start();
phpinfo();
$rs->content = ob_get_contents();
$rs->status = 200;
ob_end_clean();
});
$app->add('{^/cache/?$}', array('GET'), function($rq, $rs, &$param) {
$key = 'cache_test';
$value = 0;
if (array_key_exists($key, $rq->cache)) {
$value = intval($rq->cache[$key]) + 1;
}
$rs->cache[$key] = $value;
$rs->content = "$key : " . $value;
$rs->status = 200;
});
$app->run($req, $res);
}
}github:https://github.com/webcpp/hi-nginx
介绍:
它既是 web 服务器,也是 application 服务器。
它是 NGINX 的超集。
它性能强劲,易于开发,部署方便。
它支持多种语言混合开发 web 应用:
C++
Python
Lua
Java
PHP
【声明】文章转载自:开源中国社区 [http://www.oschina.net]
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:- RedisDesktopClient V1.3.2 发布,新增命令行模式
- RedisPlus 3.1.0 优化操作体验 新增命令交互
- SMProxy 1.2.9 发布,新增状态命令监控面板功能
- 原 荐 八月新增开源项目:假装自己是图形界面的 Git 命令行工具
- composer更新命令及常用命令
- Linux命令行与命令
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Building Social Web Applications
Gavin Bell / O'Reilly Media / 2009-10-1 / USD 34.99
Building a social web application that attracts and retains regular visitors, and gets them to interact, isn't easy to do. This book walks you through the tough questions you'll face if you're to crea......一起来看看 《Building Social Web Applications》 这本书的介绍吧!