Order
How to create a Server Script
A Server Script is a reusable server side function or class which can called inside an API Route.
In order to create a Server Script, follow these steps: -
On navigation, under Scripts, go to Server Script. You will see a list of all the Server Scripts.
Click on ‘settings icon’ on top left corner and then click ‘new’.
A form appears where you have to provide the following details: -
Name - name of the Server Script.
Active – Check / Uncheck if ready / not ready to used.
Script – The code (Business Logic Class).
Click on ‘create’ button. That’s it, you have created the Server Script.
Below is the Orders server script. In this example we are using mongoose ORM library for database operations. This server script creates and initiates the Orders Schema.
Last updated