Also, Server Code allows writing any app logic. For example, in the script you can:
- Perform calculations;
- Connect to the Appery.io Database to retrieve, update or create data;
- Send Push Notification messages;
- Invoke any 3rd party REST API;
- And anything else you might need.
Complete Server Code API.
With Appery.io Server Code option, you can:
- Create a new script or library;
- View the list of existing scripts and libraries;
- Open and edit a script or library;
- View statistics and reports for any script or all scripts;
- Import a Server Code plugin;
- Schedule a script to run periodically (schedule a job).
The Server Code page appears empty if your subscription expires (Subscription status:
“Your subscription has expired”). To regain access, sign in any time and purchase a paid plan (or renew your suspended plan payment).
Server Code also provides the following APIs out-of-the-box:
- Console - to display debug information;
- Database - to access the Appery.io Database;
- Database user - to access the Users collection inside the database;
- Push Notification - to send Push Notification messages;
- ScriptCall - for invoking another Server Code script;
- XMLHttpRequest - for invoking any 3rd party APIs;
- In Memory Data - a fast cache for storing short-lived data;
- Request - for working with input parameters into the script;
- Response - for setting up script response.
Is Server Code the same as Node.js?
When you select your script, the following tabs appear where you can:
- Script: edit the script, load it from a file or download it;
- Trace: see the trace information for the script;
- Statistics: view statistical information;
- Dependencies: select the libraries your script depends on;
- Versions: handle your script versions;
- Permissions: set and change access permissions;
- Settings: choose the database for managing user access;
- Jobs: schedule your script jobs.
Every Server Code script has a REST API which you invoke from the app. Inside the App Builder we offer a wizard to import (generate) the API for the script automatically. Go to Using APIs in an App to learn more.
Good to Know
To the app (or the outside world), a script is simply a REST API. Another way to look at it, Server Code allows you to create custom APIs very quickly.
Server Code provides a number of out-of-the-box libraries. A library can be included in any script. This allows you to invoke any function from the library.
To create a new library, click the Create library button.
You can also create custom libraries.
A Server Code plugin provides some out-of-the-box functionality that you can quickly import into your account and start using it. A Server Code plugin is a script plus any dependent libraries. A Server Code plugin is created by the Appery.io team.
A script can be scheduled to run periodically. It's called a job. For example, you can schedule a script to run every 24 hours to check the database for inventory levels.
The main Server Code page also displays total script statistics. The following information about all your scripts is available:
- Script size - storage used by all scripts;
- Execution count - the total number of all calls to scripts;
- Total calls - the total number of all API calls to backend services.
There are also statistics separately for each script when you open a script for editing.
Updated 17 days ago