https://github.com/openfaas/ruby-http
A Ruby HTTP template for OpenFaaS
https://github.com/openfaas/ruby-http
faas k8s openfaas ruby serverless
Last synced: 5 months ago
JSON representation
A Ruby HTTP template for OpenFaaS
- Host: GitHub
- URL: https://github.com/openfaas/ruby-http
- Owner: openfaas
- License: mit
- Created: 2018-09-28T19:08:24.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-04-22T09:46:11.000Z (6 months ago)
- Last Synced: 2025-04-22T11:02:44.636Z (6 months ago)
- Topics: faas, k8s, openfaas, ruby, serverless
- Language: Shell
- Size: 16.6 KB
- Stars: 12
- Watchers: 4
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 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:
```ruby
class Handler
def run(body, headers)
status_code = 200 # Optional status code, defaults to 200
response_headers = {"content-type" => "text/html"}
body = "Hello world from the Ruby template"return body, response_headers, status_code
end
end
```Add a gem to the `homepage/Gemfile` if you need additional dependencies.
Deploy:
```sh
faas-cli up -f homepage.yml
```