Skip to content

tylerklose/faastruby-cli

 
 

Repository files navigation

faastRuby

Gem Version Build Status

faastruby-cli

Local development kit and CLI tool for managing workspaces and functions hosted at faastRuby.

What is faastRuby?

faastRuby is a Serverless Software Development Platform for Ruby and Crystal.

Try it

Getting up and running is quick and easy:

  1. Install the gem so faastruby is available in your terminal
~$ gem install faastruby
  1. 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
  1. 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.

  1. 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!

faastRuby + Hyperstack = fullstack Ruby apps!

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.

Packages

No packages published

Languages

  • Ruby 95.6%
  • Crystal 3.0%
  • Other 1.4%