commit 42910066d43da50d44ea2b24892f8312735b9e9a
parent 687104f098a35f0c557ee095b135af5bf487a692
Author: Hugo Soucy <hugo.soucy@equisoft.com>
Date: Tue, 1 Oct 2019 14:22:47 -0400
Fix the httpd plugin
Diffstat:
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/plugins/httpd/init.lua b/plugins/httpd/init.lua
@@ -1,7 +1,5 @@
-- httpd.lua
-package.path = package.path .. ";../../?.lua"
-
local httpd = {}
local httpdmeta = {
__call = function(self, key, vars)
@@ -9,18 +7,17 @@ local httpdmeta = {
end
}
-local pegasus = require "pegasus"
-local path = require "path"
+local pegasus = require 'pegasus'
function httpd.init(sitedata)
local server = pegasus:new({
port = sitedata.config.portdev,
- location = "/" .. sitedata.config.sites .. path.basename(sitedata.path) .. sitedata.config.paths.html .. "/"
+ location = '/' .. sitedata.html
})
return server:start(function(request, response)
- print("= Request: " .. inspect(request.firstLine))
- print("= Response: " .. inspect(response.headFirstLine))
+ print('= Request: ' .. inspect(request.firstLine))
+ print('= Response: ' .. inspect(response.headFirstLine))
end)
end