Taken from the documentation:
FunctionHub is the package manager for general, reusable Functions for cloud vendors like AWS, Google cloud and Azure. It is the main interaction point with Cloudstash, a broader cloud based storage unit for functions and artifacts.
All the functions handling the back-end of the "SeverlessToDoListAPI" application will be hosted on FunctionHub and so they can be conveniently accessed through the cloud.
FunctionHub will provide access to them by a URL that we can later attach as a reference to the lambda’s “artifacts” property in GMT.
If you wish to skip this step move to GMT. A public FunctionHub repository is already available with all the necessary functions. The repository can be found in Cloudstash.io under the name “ServerlessToDoListApi-repo”).
Fetch the source code of the lambda functions. Visit the GitHub repository and download the files.
5 lambda functions are needed for the "ServerlessToDoListAPI" application:
- create
- delete
- get
- list
- update
- Create a user in Cloudstash.io and log in (Make sure to store the provided deploy_token).
- Create a new public/private repository in Cloudstash.io.
- Install FunctionHub-cli using your terminal.
- Create a project for each function
fuhub create <project_name>
and populate all the config.ini files with the right properties:
Create
[REPOSITORY]
org = <your_cloudstash_user>
repository = <your_functions_repository>
[FUNCTION]
name = create
version = 1.0.0
description = create an item
[RUNTIME]
provider = aws
runtime = js
handler = create.handler
Delete
[REPOSITORY]
org = <your_cloudstash_user>
repository = <your_functions_repository>
[FUNCTION]
name = delete
version = 1.0.0
description = delete an item
[RUNTIME]
provider = aws
runtime = js
handler = delete.handler
Get
[REPOSITORY]
org = <your_cloudstash_user>
repository = <your_functions_repository>
[FUNCTION]
name = get
version = 1.0.0
description = get items
[RUNTIME]
provider = aws
runtime = js
handler = get.handler
List
[REPOSITORY]
org = <your_cloudstash_user>
repository = <your_functions_repository>
[FUNCTION]
name = list
version = 1.0.0
description = list items
[RUNTIME]
provider = aws
runtime = js
handler = list.handler
Update
[REPOSITORY]
org = <your_cloudstash_user>
repository = <your_functions_repository>
[FUNCTION]
name = update
version = 1.0.0
description = update an item
[RUNTIME]
provider = aws
runtime = js
handler = update.handler
- ZIP the source code and store it in the same direcotry as the config.ini file.
- Upload the functions executing :
fuhub --token <deploy_token> upload <zipped_function>
After uploading all the functions with FunctionHub-cli, the listing of functions will be as following:
The function details of the "create" function can be seen in the following image where the user can either retrieve artifact details such as "artifactId" and "handler" or simply download the function locally.
Head over to GMT section to model your application.