comparison src/luan/host/WebHandler.java @ 1424:9ab267b9427c

better load_file()
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 22 Nov 2019 22:58:39 -0700
parents 27efb1fcbcb5
children b6030fa18839
comparison
equal deleted inserted replaced
1423:2c06a7ff4173 1424:9ab267b9427c
11 import luan.LuanException; 11 import luan.LuanException;
12 import luan.LuanTable; 12 import luan.LuanTable;
13 import luan.LuanFunction; 13 import luan.LuanFunction;
14 import luan.LuanClosure; 14 import luan.LuanClosure;
15 import luan.LuanRuntimeException; 15 import luan.LuanRuntimeException;
16 import luan.modules.BasicLuan;
17 import luan.modules.http.LuanHandler; 16 import luan.modules.http.LuanHandler;
18 import luan.modules.logging.Log4j; 17 import luan.modules.logging.Log4j;
19 18
20 19
21 public class WebHandler implements Handler { 20 public class WebHandler implements Handler {
60 } 59 }
61 60
62 private static void initLuan(Luan luan,String dir,String domain) { 61 private static void initLuan(Luan luan,String dir,String domain) {
63 security(luan,dir); 62 security(luan,dir);
64 try { 63 try {
65 LuanFunction fn = BasicLuan.load_file(luan,"classpath:luan/host/init.luan"); 64 LuanFunction fn = Luan.loadClasspath(luan,"luan/host/init.luan");
66 fn.call(dir,domain); 65 fn.call(dir,domain);
67 } catch(LuanException e) { 66 } catch(LuanException e) {
68 throw new LuanRuntimeException(e); 67 throw new LuanRuntimeException(e);
69 } 68 }
70 } 69 }