Development Tip: Use Server Code Plug-ins and Snippets for Quicker Coding

snippets

Using Server Code snippets and plug-ins are a great way to save time when making server scripts. Instead of digging through the Server Code documentation, you can simply choose one of the snippets located on the right side of the screen in script editor mode. The set of snippets provided by the Server Code API are the most common, but if you think of other useful snippets, let us know and we’ll add them to the list.

Server Code plug-ins are another way to save time when implementing your logic. To find Server Code plug-ins, go to the Server Code page and then to the Plugins tab. For now, there are two plug-ins. With them, you can quickly integrate with the Twilio or SendGrid API via XHR (XMLHTTPRequest). Simply click “Import” to create the server script based on the plug-in selected, and then customize it by specifying your API keys.

Make sure you check out all of our mobile development tips.

Do you want to build apps fast? Start developing with our trial plan!

New in Appery.io: New Ionic Components and Templates, New API Express Components, and Server Code Plug-ins and Snippets

The Appery.io team is starting 2016 with new and exciting updates and improvements to the platform!

App Builder enhancements

The latest Appery.io update brings some cool features to the visual App Builder.

New Ionic components

Two new UI components for Ionic were just released: Card and Text.

The Card can be used to visually separate information on a page. It allows for more control and flexibility, and can even be animated. This new component is based on Google’s Card UI design.

The Text component can be used to conveniently place any custom text or AngularJS expression (wrapped with {{...}}) on the page.

The Ionic Button has obtained new property – Icon Only. It makes a button look like an icon. This property converts a button to an icon by changing Icon Style and Style properties, and ignoring the Text property.

It’s now possible to copy and clone components in the App Builder. To create a full copy of a UI component with all nested children, (including other components), click the clone icon on the top right of the component:

clone_example

Cloning a component

Ionic page templates

When creating a new page in Ionic, you can choose a blank page or a page with ionContent. The blank page is a simple page without any extra components. Use it when you don’t need to make any special adjustments to the scroll or scrollbar settings. The page with ionContent is a multi-tool page with a ion-content directive and many settings provided by Ionic. Use it when you need to make flexible adjustments to page scroll behavior.

You can find more detailed templates description in our docs.

Read the rest of this entry »

Learn about Appery.io Platform APIs: Database, Push, and Server Code

Over the last two weeks, the Appery.io team has updated a number of docs related to the Database, Server Code and Push Notifications APIs. The new format is more user-friendly, making it easier to read and find information. The overview docs and API reference are now separated. This post summarizes what Appery.io Backend Services APIs are available and how to use them.

apperyio_apis

Read the rest of this entry »

Quickly Add Custom Business Logic to Your App with Server Code

Screen Shot 2015-07-01 at 2.45.21 PM

Appey.io Server Code is a powerful tool that allows you to write custom server-side business logic for your app. These are the benefits you get when you use Server Code:

  • Write and implement any business logic for an app. For example, you can write a script that checks inventory (Database), then sends a push notification, and then sends an e-mail using the SendGrid API
  • Quickly test the script during development
  • JavaScript is the language used to write the script
  • Server Code is based on the popular V8 JavaScript engine. This means you can use any APIs supported by V8
  • A Server Code script is instantly exposed via a REST API. This means you can quickly build a custom API

Read the rest of this entry »

Learn How to Create a Server Code Script to Invoke a REST API in 5 Minutes

Screen Shot 2015-07-01 at 2.45.21 PM

In this 5-minute video you will learn how to invoke a REST API from the server (instead of directly from the client. There are a number of benefits to invoke an API from the server:

  1. JavaScript is the language used to write the script (and you already know JavaScript!)
  2. Additional business logic can be added around the API. For example, in addition to sending an SMS, you can also send an email (SendGrid API)
  3. The API keys and tokens are secure
  4. Script is exposed via REST API (to be invoked from the app)
  5. Script has API to access Appery.io Database, Push
  6. A script can be saved as a library and used in other scripts
  7. Script changes can be made without updating the client (app)
  8. It’s tool to write code 🙂

Check out all the other Build in 5 Minutes videos.

Launching Server Code With Jobs Scheduler

Have you ever needed to perform operations in a certain time interval? For example – have you ever needed to check database records, and then based on specific conditions, send an appropriate push notification?

server-code 

Some parts of this can be done via client-side code, but there is no guarantee that the user’s device will be online at the right time. The solution to this lies in one of Appery.io’s great backend features, Server Code.  If you aren’t familiar with it yet, here is a quick tip: Server Code enables custom and scalable business logic in the Appery.io cloud without the need to build and maintain server infrastructure. And one of the server code features is the jobs scheduler.

All of the scheduling logic can be found in a separate Jobs tab:

jobs

You will see schedule builder if you open it:

schedule_builder

The basics of working with the jobs scheduler is simple – you choose the script that should be executed at a certain time or time interval. Then you should specify that time or interval. This can be done in two ways: by using the schedule builder or by using the Schedule expression:

schedule_expression

Unlike the schedule builder where you simply need to select the needed parameters by choosing them from comboboxes, the Schedule expression retrieves values based on Quartz. Note one important thing – the Appery.io job scheduler doesn’t use a seconds parameter in Cron expressions. So, if you use an expression such as 0 0/5 * * * ? you’ll get an error. Remove the first number (zero in this case) and the expression will be correct – 0/5 * * * ? .

The minimum interval between script invocation is based on your plan. See our pricing to learn more.

All of your scheduled scripts are displayed at the bottom of the page:

scheduled_jobs

If you no longer need to execute some of your scripts, turn them off by toggling the on/off button or delete it by clicking the cross icon.

Generally, that’s all you need to start scheduling your scripts. Simple, isn’t it? Here is detailed documentation about the Server Code jobs scheduler in case you’re stuck somewhere. Or get touch with us via forum or email to get our help. Happy coding!

 

Extending app logic with Appery.io Server Code

Screen Shot 2014-02-27 at 3.57.36 PM

Every modern app consists of two parts: front-end UI and backend. Backend services can greatly extend your app logic and help implement many useful features.  Appery.io provides a possibility to create your own server scripts without the need to maintain servers yourself.  Server code scripts (that’s how this feature is called in Appery.io) can be invoked from the app via a REST API and will  run on the Appery.io servers.

Using server code scripts provides the following advantages:

  • Broader app logic
    Use server code services to extend your app logic. You can implement various backend features such as Restore password and others.  Some code logically belongs on the server.  For example, if you need to process data retrieved from multiple sources before presenting the results to the user, its more efficient to perform that logic in the server.
  • Reusable code base
    Appery.io server scripts can be self-contained app modules which can be used from different apps. You can implement one handy feature and re-use it from all of your apps instantly and without any additional coding.
  • Code accessibility 
    As Appery.io provides powerful a collaboration feature, server code can be shared with other users too. This makes team development much easier and faster.
  • Extend with powerful 3rd party libraries 
    Server code supports several predefined libraries such as Underscore.js, moment.js, handlebar.js and others. You can also upload your own or other 3-rd party library and use it from the Appery.io. Libraries can be shared too!
  • Keep your users on the latest version of the code.  Another important advantage of server code is the ability to modify your app without having to redistribute your app to your users.  If you make changes on the client side, that requires an update in the app store, and an update by all your users.  But if your logic is server based, you can be sure that all your users always have the latest version of your app.

The server code console can help test and debug your scripts from one place without the need to run REST API services. Want to add custom app logic to your app? Start with Server Code by trying this tutorial! And, to learn more about Appery.io Server Code, visit the documentation.