When creating or editing a function, write code in our inline editor in UI as listed here: Function Templates or upload a ZIP file with your code (up to 64 MB zipped and up to 256 MB unzipped code size).
Please note: Your code should adhere to the templating rules as listed here: Function Templates
For each Function language, the ZIP file should be in a specific structure.
- Java 8: Upload the function’s JAR.
- NodeJS (4.8 & 8.3): When uploading a ZIP file for a Node JS function, the ZIP must include the function code at the top-level (root) in an index file called:
Optional: You can also have any packages you need under node_modules and all will be deployed with your Function.
- Python (2.7): When uploading a ZIP file for a Python Function, the code must be in the top-level (root) in a file called:
__main__.py. It is also possible to have pip dependencies in the zipped directory which will be deployed with the function.
- Ruby (2.4.1): When uploading a ZIP file for a ruby Function, the code must be in the top-level (root) in a file called:
Example of ZIP file structure for NodeJS:
index.js in the top level (root) of the ZIP file