Previously I described how to save data objects using REST Console. The same interface allows to save objects with related data – it is strictly a matter of formatting the request body. Consider the following two data table schemas:
Backendless REST Console is a tool capable of driving REST queries against Data Service. It is useful when you need to validate a REST command or for testing and diagnostics purposes. REST Console is available in a dedicated tab on the Data screen of the Backendless Console. Previously I wrote how to load data objects using REST Console and how to save a new data object. In this post I will describe the API to delete a data object.
The custom business logic feature in Backendless lets you add your own server-side code to handle client API requests. In this post I am going to review how to add the Data Service API handlers.
With that type of handler you can intercept and add additional logic for the APIs which store data in Backendless, run queries, update or delete data objects.
The easiest way to start building server-side Backendless code is the developer console. Login to your account, select an app and click the Business Logic icon. I assume there are some data tables in your backend, if not, make sure to create a few. Since we are going to add an event handler which works with persistent data, click Data Tables from the list of available handler categories. Click Add Event Handler, the screen should look as shown below:
Previously I wrote how to generate custom business logic code for API event handlers and how to locally debug your custom code. Now your code is ready to be pushed to the Backendless servers. Once it is out there, the Backendless infrastructure automatically handles scaling the code execution and routing requests to an instance available to run your code. The process for deploying an API event handler is very similar to the one for timers (see deploying custom business logic in timers to Backendless).
The ZIP file you downloaded from the Backendless Console (when it generated the code for an event handler) includes the deploying utility located in the /bin directory. To deploy the code, open a command prompt window and run the Deploy script. There are two of them, one for Linux (Deploy.sh) and the other for Windows (Deploy.bat). When you run the utility, it inspects all the custom code, packages and deploys it to the Backendless servers. The utility output would look similar to the one below:
Previously I wrote about the REST Console, which is a part of the Backendless Console. It is a versatile interface which lets you perform a complete CRUD (Create, Retrieve, Update, Delete) set of operations on your data stored in Backendless using the REST interface. One of my previous articles described how to use the REST Console to perform search queries (that’s the Retrieve part of CRUD). In this post I am going to demonstrate how to save new data objects using the REST Console.
Previously I described how to use the Backendless Console to generate custom business logic code. In this post I will describe one of the most amazing features in Backendless – an ability to debug custom server-side code on the developer computer before deploying it to the cloud. It would be very helpful for you to go through the previous feature to establish the surrounding context.
Once the code is generated, you can use the Download button to get a project archive (zip) with all the source code. In addition to the code the archive also contains a special command line utility which you can use to run the custom code locally. The trick of the local execution is the code inject itself into the API processing chain. This happens despite the fact that the API invocation is handled in the cloud, but the custom code runs on your computer. To put things in perspective, see the diagram below:
Video broadcasting and streaming is one of the coolest features of Backendless. Our Media Service API enables client-server functionality for working with live and on-demand audio and video content. A mobile application which uses the Media Service API can broadcast audio and video from the device’s cameras and microphone. Backendless automatically handles streaming of the received media content to other clients or recording of the content on the server. The API can also support the capability to stream a pre-recorded (on-demand) content managed by the Media Service. More details about these features are available in the Media Service documentation.
This post describes how to build an iOS application using the Swift language. The app will record a video on the server and then subsequently play it back.
In my previous post I introduced the feature of server-side API event handlers – a mechanism for injecting custom business logic into Backendless. In this post I am going to review the process of creating an event handler for User Service APIs using Backendless console. The User Service APIs include: user registration, login, logout, user update, password recovery and retrieval of user schema (a list of user properties and their types). You can build an event handler (or two event handlers – “before” and “after”) for each of these operations.
There are two types of custom (server-side) business logic supported by Backendless – timers and event handlers. In my previous posts have reviewed the entire process of developing, testing and deploying timers. Now I’m going to focus on event handlers. An event handler is a piece of custom server-side logic which can be plugged into the API processing chain. The diagram below illustrates how API processing works – the gray box is the server-side of Backendless. As you can see, there are two blocks where custom business logic can be placed – the “before” and “after” handlers:
Now that you know how to generate code for custom business logic timers (Backendless background jobs) and how to locally debug custom business logic, it is time to learn how to deploy that code to production. By “production” I mean the Backendless Online service running in the cloud. It may not be your ultimate production phase – you may still be developing the application, but it is a convenient way to distinguish it from the debugging/development step.
In order to push your custom server-side code with Timers to Backendless, the CodeRunner distribution and the zip file downloaded from the Business Logic code generator, include a command line utility. The utility name is “Deploy” and it has an appropriate extension for the supported operating systems (.sh for Linux and .bat for Windows).