这里有新鲜出炉的精品教程,程序狗速度看过来!
这是 webcppd 升级为 httpevent 后的第二个更新。
主要更新:
httpevent 是 webcppd 的继承者,在多个方面增强了后者,并且融入了 lua 开发要素,可同时支持使用 c++ 和 lua 进行 web 开放。
C++ HELLOWORLD:
- #include < httpevent.hpp > namespace httpevent { class hello : public view { void handler(const request & req, response & res) { res.send_head("Content-Type", "text/plain;charset=UTF-8") .send_body("hello,world");
- }
- };
- }
lua HELLOWORLD:
- local hello = {}
- function hello.main() httpevent.response: send_head("Content-Type", "text/plain;charset=UTF-8") : send_body('hello,world') end
- return hello
依赖:
开发例子请参考:https://github.com/webcpp/httpevent/tree/master/plugin
更多介绍参见:https://github.com/webcpp/httpevent
来源: http://www.phperz.com/article/17/0419/333538.html