Introduction to Cloud Code

Introduction to Cloud Code

The Cloud Code layer of Telerik Platform enables you to implement custom server-side logic using JavaScript. The logic can be used for validating and modifying requests and responses, sending push notifications, messages or emails, maintaining the stored data, making calls to an external service and others.

You have the option to write the code directly in the Telerik Platform portal or upload JavaScript files with the relevant code. Working with cloud code is also available in Telerik AppBuilder by Progress.

Telerik Platform supports two types of cloud code: Cloud Code for Data and Cloud Functions.

Cloud Code for Data

Cloud Code for Data is similar to a trigger in a conventional database. This type of code gets executed whenever an item is created, read, updated, or deleted. Furthermore, you can plug your code both before the query is executed and after the result is obtained. This way you can both change the query or change the result based on your custom logic.

There are many scenarios where Content Type Code can be useful. Some examples are:

  • Validating data before inserting or updating items
  • Updating related data on inserting or updating items
  • Sending emails or push notifications after inserting or deleting items
  • Enhancing data before returning it to the client (adding custom fields to items, fetching related data, etc.)

You can read more in Cloud Code for Data.

Cloud Functions

With cloud functions you can create your own code working in the cloud and call it whenever you need. Cloud functions can accept parameters and can return a result.

Each cloud function is assigned a unique RESTful endpoint. To invoke the cloud function you need to make an HTTP request to the endpoint's URL. Parameters to the function are supplied as query parameters in the URL or as HTTP headers. You can also use the body of the request to send any data you want. The result of the function is obtained through the HTTP response.

Cloud Functions can be useful in various scenarios. Some examples are:

  • Server-side logic that is not triggered by a data operation
  • Hook for integration with external products and services
  • Generating reports

You can read more in Cloud Functions.

Next Steps

See Also

Start a free trial Request a demo
Contact us: +1-888-365-2779
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.