Mercurial Hosting > luan
comparison http/src/luan/modules/http/Server.luan @ 629:35dde32c02ab 0.15
change String.matches()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 18 Jan 2016 23:07:52 -0700 |
parents | 473e456444ff |
children | ca169567ce07 |
comparison
equal
deleted
inserted
replaced
628:6510de302f95 | 629:35dde32c02ab |
---|---|
1 local String = require "luan:String" | 1 local String = require "luan:String" |
2 local gsub = String.gsub | 2 local gsub = String.gsub |
3 local match = String.match | 3 local matches = String.matches |
4 local Io = require "luan:Io" | 4 local Io = require "luan:Io" |
5 local Package = require "luan:Package" | 5 local Package = require "luan:Package" |
6 local Http = require "luan:http/Http" | 6 local Http = require "luan:http/Http" |
7 require "luan:logging/init" -- initialize logging | 7 require "luan:logging/init" -- initialize logging |
8 | 8 |
79 function Io.schemes.site(path,add_extension) | 79 function Io.schemes.site(path,add_extension) |
80 return Io.uri( dir..path, add_extension ) | 80 return Io.uri( dir..path, add_extension ) |
81 end | 81 end |
82 M.authentication_handler.setPassword(M.private_password) | 82 M.authentication_handler.setPassword(M.private_password) |
83 local base = dir | 83 local base = dir |
84 if match(base,"^classpath:") ~= nil then | 84 if matches(base,"^classpath:") then |
85 base = dir.."#"..M.welcome_file.."#"..M.welcome_file..".luan" | 85 base = dir.."#"..M.welcome_file.."#"..M.welcome_file..".luan" |
86 end | 86 end |
87 M.resource_handler.setResourceBase(Io.uri(base).to_string()) | 87 M.resource_handler.setResourceBase(Io.uri(base).to_string()) |
88 M.resource_handler.setWelcomeFiles {M.welcome_file} | 88 M.resource_handler.setWelcomeFiles {M.welcome_file} |
89 M.luan_handler.setWelcomeFile(M.welcome_file) | 89 M.luan_handler.setWelcomeFile(M.welcome_file) |