Mercurial Hosting > luan
comparison web/src/luan/modules/web/Web_server.luan @ 267:1507149fc447
rename Io.get() to Io.Uri()
git-svn-id: https://luan-java.googlecode.com/svn/trunk@268 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Wed, 29 Oct 2014 22:05:55 +0000 |
parents | 9e0d4452e649 |
children | eb27e765affb |
comparison
equal
deleted
inserted
replaced
266:4dca283b9b74 | 267:1507149fc447 |
---|---|
72 | 72 |
73 function serve(dir) | 73 function serve(dir) |
74 dir = dir.gsub("/$","") -- remove trailing '/' if any | 74 dir = dir.gsub("/$","") -- remove trailing '/' if any |
75 Http.dir = dir | 75 Http.dir = dir |
76 function Io.protocols.site(path,loading) | 76 function Io.protocols.site(path,loading) |
77 return Io.get( dir..path, loading ) | 77 return Io.Uri( dir..path, loading ) |
78 end | 78 end |
79 authentication_handler.setPassword(private_password) | 79 authentication_handler.setPassword(private_password) |
80 local base = dir | 80 local base = dir |
81 if base.match("^classpath:") ~= nil then | 81 if base.match("^classpath:") ~= nil then |
82 base = dir.."#"..welcome_file.."#"..welcome_file..".luan" | 82 base = dir.."#"..welcome_file.."#"..welcome_file..".luan" |
83 end | 83 end |
84 resource_handler.setResourceBase(Io.get(base).to_string()) | 84 resource_handler.setResourceBase(Io.Uri(base).to_string()) |
85 resource_handler.setWelcomeFiles {welcome_file} | 85 resource_handler.setWelcomeFiles {welcome_file} |
86 luan_handler.setWelcomeFile(welcome_file) | 86 luan_handler.setWelcomeFile(welcome_file) |
87 local server = Server.new(port) | 87 local server = Server.new(port) |
88 server.setHandler(hc); | 88 server.setHandler(hc); |
89 config_server(server) | 89 config_server(server) |