lib/doraemon/proxy_server.rb in doraemon-1.0.9 vs lib/doraemon/proxy_server.rb in doraemon-1.0.10
- old
+ new
@@ -52,9 +52,11 @@
_result = begin JSON.parse(_resp.body) rescue {} end
if _api_path
begin
+ _ctx_path = File.join(@root, ".context.rb")
+ eval(File.read(_ctx_path)) if File.exist?(_ctx_path)
_result = eval(File.read(_api_path)) if File.exist?(_api_path)
rescue Exception => e
_result = {
"code": -1,
"msg": "#{_req.path} 处理错误: #{e.to_s}"
\ No newline at end of file