Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhulik committed Jan 14, 2023
1 parent 0ce455f commit 1a47d4d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions hass-listener/function/handler.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
require 'sinatra'

class Handler
def run(body, headers)
status_code = 200 # Optional status code, defaults to 200
response_headers = {"content-type" => "text/plain"}
body = "Hello world from the Ruby template"

return body, response_headers, status_code
def run(request)
[200, {}, request.env.to_s]
end
end

handler = Handler.new

get '/*' do
res, res_headers, status = handler.run(request.body, request.env)

[status || 200, res_headers, res]
handler.run(request)
end

0 comments on commit 1a47d4d

Please sign in to comment.