diff src/luan/host/run.luan @ 1418:732b5de211fc

add Hosted.luan
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 18 Oct 2019 22:29:46 -0600
parents 27efb1fcbcb5
children c78d6a4e2d9a
line wrap: on
line diff
--- a/src/luan/host/run.luan	Fri Oct 18 19:38:08 2019 -0600
+++ b/src/luan/host/run.luan	Fri Oct 18 22:29:46 2019 -0600
@@ -4,17 +4,17 @@
 local do_file = Luan.do_file or error()
 local ipairs = Luan.ipairs or error()
 local Io = require "luan:Io.luan"
-local Hosting = require "luan:host/Hosting.luan"
+local Hosted = require "luan:host/Hosted.luan"
 local Logging = require "luan:logging/Logging.luan"
 local logger = Logging.logger "run"
 local NotFound = require "java:luan.modules.http.NotFound"
 local ListHandler = require "java:goodjava.webserver.handlers.ListHandler"
 local WebHandler = require "java:luan.host.WebHandler"
-Hosting.WebHandler = WebHandler
+Hosted.WebHandler = WebHandler
 
 
 local here = Io.schemes.file(".").canonical().to_string()
-Hosting.sites_dir = here.."/sites/"
+Hosted.sites_dir = here.."/sites/"
 
 do_file "classpath:luan/host/main.luan"
 
@@ -26,7 +26,7 @@
 local ContentTypeHandler = require "java:goodjava.webserver.handlers.ContentTypeHandler"
 local SafeHandler = require "java:goodjava.webserver.handlers.SafeHandler"
 
-local handler = WebHandler.new(Hosting.sites_dir)
+local handler = WebHandler.new(Hosted.sites_dir)
 local not_found_hander = NotFound.new(handler)
 handler = IndexHandler.new(handler)
 handler = ListHandler.new( handler, not_found_hander )
@@ -36,7 +36,7 @@
 server.start()
 
 
-local sites_dir = Io.schemes.file(Hosting.sites_dir)
+local sites_dir = Io.schemes.file(Hosted.sites_dir)
 for _, site_dir in ipairs(sites_dir.children()) do
 	local name = site_dir.name()
 	WebHandler.loadHandler(name)