fbpx

Serverless Platform for Ruby Developers

Build serverless applications using functions without cold starts. Faster than Lambda, as easy as Heroku, and with Crystal support!

The only FaaS platform built for Ruby

No Cold Starts

Build snappy web applications, and run it up to 20x faster than on AWS Lambda

Built-in automation

Forget about pipelines.
The platform will build and run your tests before each deploy.

Schedule periodic runs

In plain English or Cron syntax

See it in action

Hosted at Digital Ocean
Run the examples below a few times so you get a sense of the average execution time.

Hello, World!

def handler(event)
  render text: 'Hello, World!'
end






Fetch Dad Jokes API

require 'rest-client'
def handler event
  # Making a request to an external API
  # adds a few hundred ms to the execution time
  json = RestClient.get "https://icanhazdadjoke.com/", accept: :json
  joke_hash = Oj.load(json)
  render text: joke_hash['joke']
end
# Many thanks to https://icanhazdadjoke.com

Try it

1. Install the gem:

$ gem install faastruby

2. Create a function

$ faastruby new hello-world
+ d ./hello-world
+ d ./hello-world/spec
+ d ./hello-world/spec/helpers
+ f ./hello-world/spec/helpers/faastruby.rb
+ f ./hello-world/spec/handler_spec.rb
+ f ./hello-world/spec/spec_helper.rb
+ f ./hello-world/Gemfile
+ f ./hello-world/handler.rb
+ f ./hello-world/faastruby.yml
◑ Installing gems... Done!

3. Deploy the function to a workspace. The workspace name must be unique (like a username).

$ cd hello-world
hello-world$ faastruby deploy-to prod-app
Could not find credentials for 'prod-app' in '/Users/DemoUser/.faastruby.tor1'
Attemping to create workspace 'prod-app'
◓ Requesting credentials... Done!
Writing credentials to /Users/DemoUser/.faastruby
~ f /Users/DemoUser/.faastruby
Workspace 'prod-app' created
◒ Waiting for the new workspace to be ready... Done!
[build] Verifying dependencies
The Gemfile's dependencies are satisfied
[test] Running tests
...

Finished in 0.00766 seconds (files took 0.24364 seconds to load)
3 examples, 0 failures

◐ Building package... Done!
◒ Deploying 'prod-app/hello-world' Done!
Endpoint: https://api.tor1.faastruby.io/prod-app/hello-world

4. Run it:

hello-world$ curl https://api.tor1.faastruby.io/prod-app/hello-world
Hello, World!
You can also generate a CURL command:
hello-world$ faastruby run prod-app --json '{"name":"Ruby"}' --header 'My-Header: value' --query 'foo=bar' --query 'baz=fox' --curl
curl -X POST -H 'Content-Type: application/json' -H 'My-Header: value' -d '{"name":"Ruby"}' 'https://api.tor1.faastruby.io/prod-app/hello-world?foo=bar&baz=fox'

What users are saying

Subscribe to our Newsletter

FaaStRuby + HyperStack = full stack Ruby apps!

If you think JavaScript is your only option for the front-end, think again.

Hyperstack is a Ruby DSL, compiled by Opal, bundled by Webpack, powered by React.