pksurecom / lor

a fast, minimalist web framework for lua based on OpenResty

Home Page:http://lor.sumory.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lor

中文 English

A fast and minimalist web framework based on OpenResty.

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

local lor = require("lor.index")
local app = lor()

app:get("/", function(req, res, next)
    res:send("hello world!")
end)

app:run()

Examples

Installation

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

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: lor 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.

Tests

Install busted, then run test

busted test/*.test.lua

License

MIT

About

a fast, minimalist web framework for lua based on OpenResty

http://lor.sumory.com

License:MIT License


Languages

Language:Lua 97.1%Language:Shell 2.9%