Search code examples
functioneventscloudappwrite

Events disappear after deploying the cloud function in [appwrite console]


I have created a database on appwrite console to which I have added a function and gave data base id and collection id in the Events section in the bottom, after I have deployed it on the vs code the collection id and database id disappear from the events,for which I have to add them back every single time before I deploy any category for that function. Please help.


Solution

  • Do you have your events defined in your appwrite.json file? For example, for my Appwrite version 0.15.3, my appwrite.json has this Appwrite Function:

    
    {
        "$id": "process-photo",
        "name": "process-photo",
        "runtime": "node-16.0",
        "path": "appwrite-functions/process-photo",
        "entrypoint": "src/index.js",
        "vars": {
            "APPWRITE_FUNCTION_ENDPOINT": "",
            "APPWRITE_FUNCTION_API_KEY": ""
        },
        "execute": [],
        "events": [
            "buckets.*.files.*.create"
        ],
        "schedule": "",
        "timeout": 15
    }