Lua实现的Node.js Luvit

码农软件 · 软件分类 · 服务框架/平台 · 2019-09-26 14:29:14

软件介绍

Luvit - Lua + UV + Jit = NodeJS re-implemented in Lua

如上面标题所描述的,Luvit 相当于 luajit2 + libuv,编译成单个可执行文件,类似 Node.js ,可运行 .lua 文件。

示例代码(创建一个HTTP服务器)

-- Load the http library
local HTTP = require("lib/http")

-- Create a simple nodeJS style hello-world server
HTTP.create_server(function (req, res)
  res:write_head(200, {
    ["Content-Type"] = "text/plain",
    ["Content-Length"] = "11"
  })
  res:write("Hello World")
  res:finish()
end):listen(8080)

-- Give a friendly message
print("Server listening at http://localhost:8080/")


本文地址:https://codercto.com/soft/d/15446.html

C++ Primer Plus

C++ Primer Plus

Stephen Prata / 张海龙、袁国忠 / 人民邮电出版社 / 2012-6-19 / 99.00元

C++是在C语言基础上开发的一种集面向对象编程、通用编程和传统的过程化编程于一体的编程语言,是C语言的超集。本书是根据2003年的ISO/ANSI C++标准编写的。通过大量短小精悍的程序详细而全面地阐述了C++的基本概念和技术。全书分为18章和10个附录,分别介绍了C++程序的运行方式、基本数据类型、复合数据类型、循环和关系表达式、分支语句和逻辑操作符、函数重载和函数模板、内存模型和名称空间、类......一起来看看 《C++ Primer Plus》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具