File: localhost.lua

package info (click to toggle)
xavante 2.3.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 368 kB
  • sloc: sh: 86; makefile: 26
file content (54 lines) | stat: -rw-r--r-- 1,356 bytes parent folder | download | duplicates (5)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
-- This is a sample virtual host

-- Define here where Xavante HTTP documents scripts are located
--
local webDir = '/usr/share/doc/xavante/'

local simplerules = {

    { -- URI remapping example
      -- here / -> /README
      -- 
      match = "^[^%./]*/$",
      with = xavante.redirecthandler,
      params = {"README"}
    }, 

    { -- filehandler example
      -- /README -> webDir/README
      --
      match = ".",
      with = xavante.filehandler,
      params = {baseDir = webDir}
    },

    -- { -- This is the  WSAPI launcher, it automatically wraps each WSAPI
    --   -- app in a (reused) ring
    --   -- remember to require 'wsapi.xavante'
    --   --
    --   match = { "%.ws$", "%.ws/"},
    --   with = wsapi.xavante.makeGenericHandler(webDir)
    -- },

    -- { -- This is a cgilua handler example
    --   -- remember to require 'xavante.cgiluahandler'
    --   --
    --   match = {"%.lp$", "%.lp/.*$", "%.lua$", "%.lua/.*$" },
    --   with = xavante.cgiluahandler.makeHandler (webDir)
    -- },
    
    -- { -- This is an orbit example
    --   -- remember to require 'orbit.ophandler'
    --   --
    --   match = {"%.op$", "%.op/.*$" },
    --   with = orbit.ophandler.makeHandler (webDir)
    -- },

} 

-- add your vhost rules to the virtualhosts map
-- 
config.virtualhosts["localhost:8080"] = {
	rules = simplerules,
}