Changed crystal template, picked latest flask one
This commit is contained in:
@ -1,21 +1,7 @@
|
||||
require "http/request"
|
||||
require "http/headers"
|
||||
require "json"
|
||||
|
||||
class Handler
|
||||
def run(request : HTTP::Request)
|
||||
|
||||
if request.body.nil?
|
||||
return {
|
||||
body: "Foo",
|
||||
status_code: 200,
|
||||
headers: HTTP::Headers{"Content-Type" => "text/plain"},
|
||||
}
|
||||
end
|
||||
|
||||
{
|
||||
body: "Hello, Crystal. You said: #{request.body.try(&.gets_to_end)}",
|
||||
status_code: 200,
|
||||
headers: HTTP::Headers{"Content-Type" => "text/plain"},
|
||||
}
|
||||
def run(req : String)
|
||||
return JSON::Any.new("Hello, Crystal. You said: #{req}")
|
||||
end
|
||||
end
|
||||
|
@ -1,2 +1,7 @@
|
||||
name: crystal-http-template
|
||||
name: crystal_faas_function
|
||||
version: 0.1.0
|
||||
|
||||
# dependencies:
|
||||
# pg:
|
||||
# github: will/crystal-pg
|
||||
# version: "~> 0.5"
|
||||
|
Reference in New Issue
Block a user