采用MoonScript编写的Web框架:Lapis

jopen 11年前

Lapis是一个采用MoonScript 或 Lua来开发Web应用的框架,运行在一个Nginx定制版 OpenResty 之中。

lapis = require "lapis"    class extends lapis.Application    -- Define a basic pattern that matches /    "/": =>      profile_url = @url_for "profile", name: "leafo"      @html ->        h2 "Welcome!"        text "Go to my "        a href: profile_url, "profile"      -- Define a named route pattern with a variable called name    [profile: "/:name"]: =>      @html ->        div class: "profile", ->          text "Welcome to the profile of ", @params.name

项目主页:http://www.open-open.com/lib/view/home/1400121567082