hugo.soucy.cc

The personnal website source code of Hugo Soucy. Creates from an homebrewed static website generator (Ferron).
Log | Files | Refs

commit 579631ed4015c5a2068cbfc1d91fa3430beb5990
parent 0806ba735de05696e01d6a7d54295dbf7ed36be2
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Mon, 15 Oct 2018 22:24:34 -0400

Rename httpd.lua to init.lua

Diffstat:
Dplugins/httpd/httpd.lua | 17-----------------
Aplugins/httpd/init.lua | 18++++++++++++++++++
2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/plugins/httpd/httpd.lua b/plugins/httpd/httpd.lua @@ -1,17 +0,0 @@ -package.path = package.path .. ";../../?.lua" - -local pegasus = require "pegasus" -local inspect = require "inspect" -local siteconfig = require "sites.hugosoucycc.config" - -print(inspect(siteconfig)) -os.execute("pwd") - -local server = pegasus:new({ - port='8181', - location='/sites/hugo.soucy.cc/public_html/' -}) - -server:start(function (request, response) - print "It's running..." -end) diff --git a/plugins/httpd/init.lua b/plugins/httpd/init.lua @@ -0,0 +1,18 @@ +package.path = package.path .. ";../../?.lua" + +local pegasus = require "pegasus" +local path = require "path" +local httpd = {} + +function httpd.init(sitedata) + local server = pegasus:new({ + port = sitedata.config.portdev, + location = "/" .. sitedata.config.sites .. path.basename(sitedata.path) .. sitedata.config.paths.html .. "/" + }) + + return server:start(function (request, response) + print("!!!!") + end) +end + +return httpd