Hi everyone, today I'm going to show you how to get started with LazyDB lua cloud functions!
Create a lua cloud function
Creating a lua cloud function is really simple, you only need to db.create("your/path", return "My cool function"). This is how simple it is to create a lua function, of course, you can also use your dashboard to create the file as a string and add your lua code to it!
Here is a simple lua function to get the current amount of registered users.
Run a lua cloud function in JS
Run a lua cloud function is really simple, you only need the path to your function and you can pass custom if you want to use it in your cloud function.
Run a lua cloud function in an HTML template
if you want, you can run a lua function in your HTML file and directly put the result in your file when someone wants to access it, here is an example of how to use our previous lua function to display registered users on our website.