中文 English
A fast and minimalist web framework based on OpenResty .
local lor = require("lor.index") local app = lor() app:get("/", function(req, res, next) res:send("hello world!") end) app:run()
git clone https://github.com/sumory/lor cd lor sh install.sh /opt/lua # install lor in /opt/lua/lor # or sh install.sh # install lor in /usr/local/lor
or you can usehomebrew-lor on Mac OSX.
$ brew tap syhily/lor $ brew install lor
Middleware
A quick way to get started with lor is to utilize the executable cli tool lord
to generate an scaffold application.
lord
is installed with lor
framework. it looks like:
$ lord -h lor ${version}, a Lua web framework based on OpenResty. Usage: lord COMMAND [OPTIONS] Commands: new [name] Create a new application start Starts the server stop Stops the server restart Restart the server version Show version of lor help Show help tips
Create the app:
$ lord new lor_demo
Start the server:
$ cd lor_demo & lord start
Visit http://localhost:8888 .
Install busted , then run test
rm -rf lor/lib/utils/path_to_regexp.lua mv lor/lib/utils/path_to_regexp_lua.lua lor/lib/utils/path_to_regexp.lua busted test/*.test.lua
https://github.com/syhily/homebrew-lor maintained by@syhily
MIT