Mercurial Hosting > luan
comparison src/luan/host/Init.luan @ 1238:3d29033de2bf
changes for https
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 11 Jun 2018 22:03:09 -0600 |
parents | 22228c12b6dd |
children | 2612e4307987 |
comparison
equal
deleted
inserted
replaced
1237:275d1b52dbce | 1238:3d29033de2bf |
---|---|
1 local Luan = require "luan:Luan.luan" | 1 local Luan = require "luan:Luan.luan" |
2 local error = Luan.error | 2 local error = Luan.error |
3 local do_file = Luan.do_file or error() | |
3 local String = require "luan:String.luan" | 4 local String = require "luan:String.luan" |
4 local gsub = String.gsub or error() | 5 local gsub = String.gsub or error() |
5 | 6 |
6 | 7 |
7 local Init = {} | 8 local Init = {} |
60 local Io = require "luan:Io.luan" | 61 local Io = require "luan:Io.luan" |
61 local Http = require "luan:http/Http.luan" | 62 local Http = require "luan:http/Http.luan" |
62 local Hosting = require "luan:host/Hosting.luan" | 63 local Hosting = require "luan:host/Hosting.luan" |
63 local Mail = require "luan:mail/Mail.luan" | 64 local Mail = require "luan:mail/Mail.luan" |
64 | 65 |
65 Init.password = Luan.do_file(dir.."/info.luan").password or error() | 66 Init.password = do_file(dir.."/info.luan").password or error() |
66 | 67 |
67 Http.dir = "file:"..dir.."/site" | 68 Http.dir = "file:"..dir.."/site" |
68 | 69 |
69 function Io.schemes.site(path,loading) | 70 function Io.schemes.site(path,loading) |
70 return Io.uri( Http.dir..path, loading ) | 71 return Io.uri( Http.dir..path, loading ) |
82 password = "luanhost"; | 83 password = "luanhost"; |
83 port = 2525; | 84 port = 2525; |
84 }.send | 85 }.send |
85 | 86 |
86 | 87 |
88 -- callback to luanhost code | |
89 do_file "file:init.luan" | |
90 | |
91 | |
87 return Init | 92 return Init |