lib/faastruby/local/crystal_runtime.cr in faastruby-0.5.21 vs lib/faastruby/local/crystal_runtime.cr in faastruby-0.5.22
- old
+ new
@@ -1,13 +1,16 @@
require "base64"
require "json"
require "yaml"
+macro require_handler
+ require {{env("HANDLER_PATH")}}
+end
+
+require_handler
+
module FaaStRuby
- macro require_handler
- require {{env("HANDLER_PATH")}}
- end
class Event
JSON.mapping(
body: String?,
headers: Hash(String, String | Nil),
context: String?,
@@ -65,11 +68,9 @@
output = render json: {"error" => e.message, "location" => backtrace}.to_json, status: 500
end
end
end
end
-
-FaaStRuby.require_handler
def render(icon : String? = nil, jpeg : String? = nil, gif : String? = nil, png : String? = nil, io : Bytes? = nil, css : String? = nil, svg : String? = nil, js : String? = nil, inline : String? = nil, html : String? = nil, json : String? = nil, yaml : String? = nil, text : String? = nil, status : Int32 = 200, headers : Hash(String, String) = {} of String => String, content_type : String? = nil, binary : Bool = false)
headers["Content-Type"] = content_type if content_type
bin = false
case
\ No newline at end of file