hi-nginx -1.0.3 已经发布。
此次更新主要内容如下:
新增lua语言支持
统一并标准化c++,python.lua开发接口
hi-nginx是基于nginx最新版开发的多语言通用服务器,它不仅继承了nginx的全部功能,100%兼容nginx,而且支持多种语言混合开发web应用。性能强劲,易于开发,部署方便。
目前,hi-nginx支持混合使用c++和python以及lua同时进行web应用开发,而无需其他后端应用服务器。hi-nginx本身就合并了后端应用服务器的功能。
hi-nginx还提供两个基于tengine和openresty的分支版本。
更多使用说明请移步:
https://github.com/webcpp/hi-nginx
https://github.com/webcpp/hi_demo
https://github.com/webcpp/hi-tengine
https://github.com/webcpp/hi-openresty[code]c++ 例子:
#include "servlet.hpp"
namespace hi{
class hello : public servlet {
public:
void handler(request& req, response& res) {
res.headers.find("Content-Type")->second = "text/plain;charset=UTF-8";
res.content = "hello,world";
res.status = 200;
}
};
}
extern "C" hi::servlet* create() {
return new hi::hello();
}
extern "C" void destroy(hi::servlet* p) {
delete p;
}
python例子:
location = /pyecho {
hi_python_content "hi_res.status(200)\nhi_res.content('hello,world')" ;
}
location ~ \.py$ {
hi_python_script python;
}
lua例子:
location = /luaecho {
hi_lua_content "hi_res:status(200)\nhi_res:content('hello,world')" ;
}
location ~ \.lua$ {
hi_lua_script lua;
}[/code]软件详情:https://github.com/angular/angular/
下载地址:https://github.com/angular/angular/archive/4.2.2.zip
来自:开源中国社区

