Deploy Full Serverless Applications with a Single Command
One of our main objectives with the Fn Project is to have a very easy and elegant user experience. From your first touch with our quickstart to building and deploying complex applications, we want to make the experience drop dead simple. Deploying a single function has always been easy — fn deploy
— and now you can deploy an app consisting of any number of functions almost as easily.
First, make an app.yaml
file and put it in the root directory of your application, eg:
name: myawesomeapp
You should organize your Fn application code in a directory structure that matches your endpoints, for example:
- app.yaml
- func.yaml
- func.go
- hello/
- func.yaml
- func.js
- users/
- func.yaml
- func.rb
The URL's to access those functions would then be:
https://abc.io/ -> root function
https://abc.io/hello -> function in hello/ directory
https://abc.io/users -> function in users/ directory
Then assuming you have an Fn Server running (`fn start` if you don’t), just run:
fn deploy --all
That’s it! This will use the app.yaml
for some context then walk and deploy each function in your app.
Here’s an example app you can quickly clone and deploy: https://github.com/treeder/fn-app-example
And here’s the docs on Fn applications: https://github.com/fnproject/fn/blob/master/docs/developers/apps.md