Make sure to have Foundry installed first:
For Foundry to work it must have access to two files:
foundry.yaml configuration file
package.json file for your Cloud Functions
A structure of a project using Foundry might look like this:
myproject+- functions/ # Directory containing all your Cloud Functions|+- node_modules/|+- package.json # package.json for your Cloud Functions|+- foundry.yaml # Foundry configuration file|+- index.js # Root index.js file with exports for all your Cloud Functions
You use Foundry CLI to start your session and connect to your cloud development environment. Here's a basic example:
# Go to the directory where is package.json for your Cloud Functions$ cd myproject/functions# Run this only once to generate the initial foundry.yaml config file$ foundry init# Start your session and connect to your cloud development environment$ foundry go
However, Foundry won't be able to load your Firebase Cloud Functions just yet. To have your Cloud Functions loaded you must define them in the
foundry.yaml configuration file.
To learn more on how to add your Cloud Functions into the configuration file please read:
To learn more on how to use Foundry CLI please read:
Once your cloud environment is ready and the configuration file is set up, you can start coding. Foundry will install the dependencies during the first run. Then you will see that Foundry triggers all functions you specified in the configuration file each time you save your code.