-
Looking for help? Join our Slack!.
Local development kit and CLI tool for managing workspaces and functions hosted at faastRuby.
faastRuby is a Serverless Software Development Platform for Ruby and Crystal.
Getting up and running is quick and easy:
- Install the gem so
faastruby
is available in your terminal
~$ gem install faastruby
- Create a new faastRuby project
~$ faastruby new-project my-project
+ d ./myproject
+ f ./myproject/project.yml
+ f ./myproject/secrets.yml
+ d ./myproject/functions/root
+ f ./myproject/functions/root/index.html.erb
+ f ./myproject/functions/root/template.rb
+ f ./myproject/functions/root/handler.rb
+ f ./myproject/functions/root/faastruby.yml
+ d ./myproject/functions/catch-all
+ f ./myproject/functions/catch-all/404.html
+ f ./myproject/functions/catch-all/handler.rb
+ f ./myproject/functions/catch-all/faastruby.yml
+ f ./myproject/public/faastruby.yml
+ f ./myproject/.gitignore
Initialized empty Git repository in /Users/DemoUser/myproject/.git/
Project 'myproject' initialized.
Now run:
$ cd myproject
$ faastruby local
- Fire up the local development environment for your new project
~$ cd myproject
~/myproject$ faastruby local
Puma starting in single mode...
* Version 3.12.0 (ruby 2.5.3-p105), codename: Llamas in Pajamas
* Min threads: 0, max threads: 32
* Environment: production
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
2019-03-16 21:09:36 -0300 | Detecting existing functions.
---
2019-03-16 21:09:36 -0300 | Ruby functions: ["lists/pets", "root", "catch-all", "ruby"]
---
2019-03-16 21:09:36 -0300 | Crystal functions: []
---
2019-03-16 21:09:37 -0300 | Listening for changes.
---
As you can see, this runs with Ruby only. If you want to run Crystal as well (similar to Ruby, but with types and compiled to run very fast), simply install Crystal and start faastruby local
again.
faastruby local
is very powerful. When you add a new folder with a handler.rb
or handler.cr
, it will automatically be detected. faastRuby will automatically add the configuration for the function so you can jump straight in.
Changes to the code will automatically be detected and immediately refreshed for you, making local development easy and comfortable.
- Deploy it to the cloud:
~/hello-world$ faastruby deploy
...
* Project URL: https://myproject-stage-abd123.tor1.faast.cloud
Now visit that url in the browser!
Do 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.