Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 467 Bytes

code.md

File metadata and controls

23 lines (17 loc) · 467 Bytes
lapis = require "lapis"

lapis.serve class extends lapis.Application
  "/": =>
    profile_url = @url_for "user_profile", name: "leafo"
    @html ->
      h2 "Welcome!"
      text "Go to my "
      a href: profile_url, "profile"

  [user_profile: "/:name"]: =>
    @html ->
      div class: "profile", ->
        text "Welcome to the profile of ", @params.name
$ luarocks install --server=http://rocks.moonscript.org/manifests/leafo lapis