comparison web/src/luan/modules/web/Web_server.luan @ 258:4dfa86dbca45

rename "java:" to "classpath:" git-svn-id: https://luan-java.googlecode.com/svn/trunk@259 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Tue, 28 Oct 2014 20:38:04 +0000
parents 2b6f51d7af40
children f1f7d8c7e94e
comparison
equal deleted inserted replaced
257:c5c60eca33dd 258:4dfa86dbca45
71 end 71 end
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 Package.path = dir .. "?.luan;java:luan/modules/?.luan" 76 Package.path = dir .. "?.luan;classpath:luan/modules/?.luan"
77 authentication_handler.setPassword(private_password) 77 authentication_handler.setPassword(private_password)
78 local base = dir 78 local base = dir
79 if base.match("^java:") ~= nil then 79 if base.match("^classpath:") ~= nil then
80 base = dir.."#"..welcome_file.."#"..welcome_file..".luan" 80 base = dir.."#"..welcome_file.."#"..welcome_file..".luan"
81 end 81 end
82 resource_handler.setResourceBase(Io.File(base).to_string()) 82 resource_handler.setResourceBase(Io.File(base).to_string())
83 resource_handler.setWelcomeFiles {welcome_file} 83 resource_handler.setWelcomeFiles {welcome_file}
84 luan_handler.setWelcomeFile(welcome_file) 84 luan_handler.setWelcomeFile(welcome_file)