Custom Cloud Code
This guide will teach you how to set up your own Cloud Code.
Overview
This guide will teach you how to set up your own Cloud Code.
Custom Cloud Code replaces the old Moralis-hosted Cloud Functions:
Configuration
By default the cloud code is located in src/cloud/main.ts
.
Create a new file inside src/cloud/
folder and name it cloud.ts
.
Now add the following to src/cloud/main.ts
to import the file:
Adding custom cloud code
Add some cloud functions inside your newly created file src/cloud/cloud.ts
:
Build and run
Build the project:
And then run it locally:
Accessing cloud code from client
Now on a Moralis v1 client, you can call your custom cloud functions using the Moralis v1 syntax:
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
If you don't know how to set up a Moralis v1 client, head over to Client connection.
You can also watch the following video tutorial which goes through the whole setup.
Video tutorial
Last updated