01-13-2017, 10:49 AM
It would most likely look like this:
-- handler.lua
StaticFileHandler = {}
StaticFileHandler.__index = StaticFileHandler
function StaticFileHandler.new(folder)
local this = {}
setmetatable(this, StaticFileHandler)
this.folder = folder
return this
end
function StaticFileHandler:handle_request(request)
-- something to handle the request
return response
end
-- main.lua
cWebServer:get().mount(StaticFileHandler.new("./public/")).onto("/")

