[SOLVED] Cloud Function Code Syncing is not working

Hi all,
I’m facing an issue running my cloud function in VS code IDE. I have installed the moralis-admin cli package “npm i -g moralis-admin-cli”.

Moralis.Cloud.beforeSave("PolygonTokenTransfers", async(request) => {
    const confirmed = request.object.get("confirmed");
    const toAddress = request.object.get("to_address");

    if (confirmed && toAddress === "ETHEREUM_ADDRESS") {
        let data = request.object;

        await Moralis.Cloud.httpRequest({
            method: "POST",
            url: "API_URL",
            body: data,
            headers: {
                "Content-Type": "application/json",
            },
        });
    }
});

“moralis-admin-cli watch-cloud-folder --moralisApiKey API_KEY–moralisApiSecret SECRET_KEY–moralisSubdomain SUBDOMAIN --autoSave 1 --moralisCloudfolder PATH\moralis-cloud-function\cloudFile.js”

The console prints Changes Uploaded Correctly
But in the dashboard, I don’t see my cloud function code.

based on that command you have to specify a folder not a file

1 Like

Thank you. It Worked

1 Like