46 lines
1.0 KiB
Lua
46 lines
1.0 KiB
Lua
local lapis = require("lapis")
|
|
local config = require("lapis.config").get()
|
|
local json_params = require("lapis.application").json_params
|
|
|
|
local app = lapis.Application()
|
|
app:enable("etlua")
|
|
app.layout = require "views.layout"
|
|
|
|
local autoload = require("lapis.util").autoload
|
|
local handlers = autoload("handlers")
|
|
|
|
local page_titles = {}
|
|
|
|
if string.find(ngx.var.host, "panamaracing.club") then
|
|
page_titles = {
|
|
name = "Panama Racing Club Archive",
|
|
url = "panamaracing.club",
|
|
style = "panamastyle.css"
|
|
}
|
|
elseif string.find(ngx.var.host, "videohotmix.net") then
|
|
page_titles = {
|
|
name = "Hotmix Video Archive",
|
|
url = "videohotmix.net",
|
|
style = "hotmixstyle.css"
|
|
}
|
|
else
|
|
page_titles = {
|
|
name = "Local Test Archive",
|
|
url = "localhost",
|
|
style = "style.css"
|
|
}
|
|
end
|
|
|
|
app:get("/", function(self)
|
|
self.titles = page_titles
|
|
return handlers.Roothandler(self)
|
|
end)
|
|
|
|
app:get("/*", function(self)
|
|
self.titles = page_titles
|
|
return handlers.Roothandler(self)
|
|
end)
|
|
|
|
|
|
return app
|