When creating or editing a function you can write your code in our inline editor in UI as listed here: Function Templates or you can upload a ZIP file with your code.
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 your function JAR.
- NodeJS (4.8 & 8.3): When uploading a ZIP file for a Node JS function, your ZIP must include your function code at the top level (root) in an index file called: 'index.js'.
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 your Python Function, your code must be in top level root) in a file called: '__main__.py'. You can also have pip dependencies in your zipped directory which will be deployed with your function.
- Ruby (2.4.1): When uploading a ZIP file for your ruby function your code must be in top level (root) in a file called: 'index.rb'.
Example of ZIP file structure for NodeJS:
Note the index.js in the top level (root) of the ZIP file