aLiLua:一个lua web 框架
aLiLua 是一套基于 epoll/kqueue/Lua 构建的网络服务开发框架
aLiLua 使用 epoll 进行网络/文件IO事件读写,对Lua协程进行调度,其性能高效并且简单
http://alilua.com/
https://github.com/oneoo/alilua
example
local db = mysql:new()
local db_ok, err, errno, sqlstate = db:connect({
host = "localhost",
port = 3306,
pool_size = 256,
database = "db",
user = "user",
password = "***"})
if not db_ok then
header('HTTP/1.1 503 ServerError')
die('MySQL Connection Error.')
end
local res, err, errno, sqlstate = db:query("SELECT * FROM t1 LIMIT 1")
if not res then
echo("bad result: ", err, ": ", errno, ": ", sqlstate, ".")
else
echo("result: ", json_encode(res)..'\n')
end
0
See Also
Nearby
- 上一篇 › SAE 与第三方安全防护的坑
- 下一篇 › 1.04和2.1到底区别在哪?
luvit 被忽视的lua 高性能框架 https://github.com/luvit/lit
@ego008 嗯嗯