nrk (owner)

Revisions

gist: 159949 Download_button fork
public
Description:
Short code snippet that shows how to launch Mercury's greetings sample using Xavante.
Public Clone URL: git://gist.github.com/159949.git
Embed All Files: show embed
mercury-xavante.lua #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--[[
Short code snippet that shows how to launch Mercury's greetings sample using Xavante.
 
Mercury: http://github.com/nrk/mercury/
Xavante: http://www.keplerproject.org/xavante/
]]
 
require 'luarocks.require'
require 'xavante'
require 'wsapi.xavante'
 
package.path = package.path .. ';/var/www/?.lua'
 
xavante.HTTP{
    server = {host = "127.0.0.1", port = 7654},
 
    defaultHost = {
        rules = {
            {
                match = { "^/(.-)$" },
                with = wsapi.xavante.makeHandler('greetings')
            }
        }
    }
}
 
xavante.start()