In fn
, an application is a group of functions with path mappings (routes) to each function (learn more).
We've tried to make it easy to work with full applications by providing tools that work with all the applications functions.
All you have to do is create a file called app.yaml
in your applications root directory, and the only required field is a name:
name: myawesomeapp
Once you have that file in place, the fn
commands will work in the context of that application.
The root app directory can also contain a func.yaml
which will be the function access at /
.
By default, the function name and path will be the same as the directory structure. For instance, if you have a structure like this:
- app.yaml
- func.yaml
- func.go
- hello/
- func.yaml
- func.js
- users/
- func.yaml
- func.rb
The URL's to access those functions will be:
http://abc.io/ -> root function
http://abc.io/hello -> function in hello/ directory
http://abc.io/users -> function in users/ directory
fn deploy --all
If you're just testing locally, you can speed it up with the --local
flag. Or if you want to deploy to a different app, use the --app APPNAME
flag.
To deploy the hello
function only, from the root dir, run:
fn deploy hello
See https://github.com/treeder/fn-app-example for a simple example. Just clone it and run fn deploy --all
to see it in action.