Lor

基于 OpenResty 的快速、简约的 lua web 框架。「a fast, minimalist web framework for lua based on OpenResty」

Lor

https://travis-ci.org/sumory/lor.svg?branch=master GitHub release license

中文 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()

Examples

Installation

  1. shell
git clone https://github.com/sumory/lor
cd lor
make install

LOR_HOME and LORD_BIN are supported by Makefile, so the following command could be used to customize installation:

make install LOR_HOME=/path/to/lor LORD_BIN=/path/to/lord
  1. opm

opm install is supported from v0.2.2.

opm install sumory/lor

lord cli is not supported with this installation.

  1. homebrew

you can use homebrew-lor on Mac OSX.

$ brew tap syhily/lor
$ brew install lor

Features

  • Routing like Sinatra which is a famous Ruby framework
  • Similar API with Express, good experience for Node.js or Javascript developers
  • Middleware support
  • Group router support
  • Session/Cookie/Views supported and could be redefined with Middleware
  • Easy to build HTTP APIs, web site, or single page applications

Docs & Community

Quick Start

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 app:

$ lord new lor_demo

Start server:

$ cd lor_demo && lord start

Visit http://localhost:8888.

Tests

Install busted, then run test

busted spec/*

Homebrew

https://github.com/syhily/homebrew-lor maintained by @syhily

Contributors

License

MIT

主要指標

概覽
名稱與所有者sumory/lor
主編程語言Lua
編程語言Shell (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2016-01-14 08:19:34
推送於2024-01-02 14:22:58
最后一次提交2022-01-04 16:19:21
發布數12
最新版本名稱v0.3.4 (發布於 )
第一版名稱v0.1.0 (發布於 )
用户参与
星數1k
關注者數82
派生數180
提交數261
已啟用問題?
問題數73
打開的問題數11
拉請求數23
打開的拉請求數1
關閉的拉請求數12
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?