Build snappy web applications, and run it up to 20x faster than on AWS Lambda
Forget about pipelines.
The platform will build and run your tests before each deploy.
In plain English or Cron syntax
Hosted at Digital Ocean
Run the examples below a few times so you get a sense of the average execution time.
def handler(event) render text: 'Hello, World!'
end
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
$ gem install faastruby
$ 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!
$ 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
hello-world$ curl https://api.tor1.faastruby.io/prod-app/hello-world
Hello, World!
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'