What is Cloud Code and Why Should You Care?

by Lohith G N on October 04, 2014

An easy-to-use Back-end-as-a-service (BaaS) can make rapidly developing your app not only a possibility, but an enjoyable experience. A good BaaS will work for simple "CRUD-based" (or "forms-over-data") apps as well as more complicated scenarios. The trouble is that when your app outgrows the simpler scenarios, you often need "hooks" on the server side for things like validation, record transformation and more. When you're using Everlive, this is where "Cloud Code" comes in.

What is Cloud Code?

"Cloud Code" enables you to execute JavaScript before or after "CRUD" (Create-Read-Update-Delete) operations in Everlive. So that means the following events have hooks to where you can execute "Cloud Code":

  • Before Create
  • After Create
  • Before Read
  • After Read
  • Before Update
  • After Update
  • Before Delete
  • After Delete

(Sensing a pattern here? :-))

As you'd expect, any of the Before events are executed before the request is processed. Conversely, any After events are executedafter the request has been processed.

These CRUD hooks are available on any Content Type you create (as well as the built-in Users Content Type).

How do You Use It?

While you can upload JavaScript files to Everlive, most of the time (at least initially), you will be using Everlive's web interface to add cloud code. To use the web interface, simply follow these steps:

  • Log into Everlive
  • Pick the Project
  • Click on the "Types" link (on the left)
  • Select the Content Type for which you want to create Cloud Code
  • Click the "Cloud Code" link near the top right


Lohith G N

Technical Evangelist, Telerik India

Production Engineer by Education, Software Engineer by profession. Technical Evangelist, Telerik India. He's had almost a decade in the industry. Likes Cricket, Bryan Adams and Friends.

More from Lohith G N
All articles

Follow us