Skip to content

A Ruby HTTP template for OpenFaaS

License

Notifications You must be signed in to change notification settings

budacom/ruby-http

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ruby-http

Usage:

faas template pull https://github.com/openfaas-incubator/ruby-http
faas new --lang ruby-http homepage

Example:

Edit the homepage/handler.rb file to return some HTML:

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

    return body, response_headers, status_code
  end
end

Add a gem to the homepage/Gemfile if you need additional dependencies.

Deploy:

faas-cli up -f homepage.yml

About

A Ruby HTTP template for OpenFaaS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 57.7%
  • Dockerfile 42.3%