fh-serverless is a Node CLI package that allows you to optimize and generate configuration files for Serverless projects.
To use fh-serverless, you must have Node.js installed on your machine. To install the package, run the following command:
npm install -g fh-serverless
The generate command creates the serverless.yml configuration file.
fh-serverless generate <path>
Available options:
- -s, --script-folder : Specifies the path to the script folder.
- -e, --extensions <extensions...>: Specifies the format of the lambdas without the = attribute and separated by space.
To use fh-serverless, your project must contain a mandatory scripts folder. If the scripts folder is not in the root directory of your project, you can specify the folder path when calling the commands.
Your project must contain a mandatory project.json file. This file is responsible for storing the default configurations for your serverless.yml file.
You can add a globalFunctionsConfig property to your project.json file. Any attributes added within this property will also appear within each function in the functions attribute of your serverless.yml file.