Moving App Logic to the Server: How to Query the Database from a Server Code Script

Posted: May 24th, 2017Author:

The Appery.io Database provides storage for your mobile app data. You can store data such as users, orders, purchases, products or anything else. The Appery.io Database is a cloud NoSQL database and provides a very simple and elegant REST API to work with the database.

One of the most common cases for an enterprise mobile app is to create/save a new item/record and then redisplay the list in the app with the newly created item.

Accessing the database directly from the client is fine but requires two requests to the database.

  1. A request to save the new item/record into the database.
  2. Once the 1st request completes, on its success, a request to get the updated list to display in the app.

A better approach is to do both the create and list in a single request from the app. This is very simple to do from Appery.io Server Code script. The following script shows how to create a new record and then get the updated list:

In this simple script you first create a new Person object (line 8) and then do another query to get the updated list of people (line 14). The script response returns the updated list of people. This script automatically has a REST API which is the invoked from the app.

What’s most important, there is only a single request from the app to the Server Code script. A single request is usually better than two requests. Also, you can add additional logic to the script without impacting the app. For example, you can send an email when a new person is added. Or, you can send  Push Notification when a new person is added. All this can be done without impacting the app. That’s nice.

If you want to learn more about Server Code, check out our YouTube channel Server Code playlist.

Development Tip: Using Microsoft Azure and Google Cloud SQL with API Express

Posted: February 3rd, 2016Author:

api_express_service_builderAppery.io API Express enables enterprises to easily and securely integrate apps with any back-end system. Recently, the Appery team has published two guides on how to create databases with Microsoft Azure and Google Cloud SQL and then use them with API Express. If you are new to API Express, start with this beginners tutorial. It shows you how to create services based on API Express models and perform CRUD operations.

Check the API Express documentation, and make sure to check out all of our mobile development tips.

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

Display Images from a Cloud Database Using Generated REST APIs

Posted: September 15th, 2015Author:

UI-image-componentIn this post you are going to learn how to access images uploaded to a cloud database via REST APIs and display the images in the app. This is the second post about working with images. You can read the first post here:

Quickly Upload, Display, and Customize Images from the Database with the Built-in Files Collection.

Let’s say you have a list of images, icons, or avatars that you have uploaded to a database. Maybe you are building a contacts app and would like to display employee head shot or just a list of products. Now you would like to display them in your app. In this tutorial we are going to show you how to do that — it’s fast and simple.

Read the rest of this entry »

Learn How to Quickly Upload, Display, and Customize Images from the Database with the Built-in Files Collection

Posted: September 10th, 2015Author: and

Upload image files

Virtually any mobile app needs to store data. The Appery.io platform offers an integrated cloud-based database for storing any app data. Every database that you create comes with a number of collections predefined. The collections are:

  • Users – for user management.
  • Files – for storing binary data such as images and other files.
  • Devices – for sending targeted push messages.
  • Customer collection – any number of custom collections that you need in your app.

Read the rest of this entry »

Building a Native App with Ionic, AngularJS, and Appery.io

Posted: August 6th, 2015Author:

For years, developers had to make a choice: build a single hybrid app with a so-so user experience, or build a native app for each platform with a great user experience. Developers don’t have to make this choice anymore. By integrating the Ionic SDK into Appery.io, developers can build enterprise HTML5/hybrid apps on a single code base that offer a native experience across all platforms. The Appery.io platform’s visual tooling lowers the skills barrier, empowering a broader base of developers and business analysts to create effective and intuitive mobile applications.

In this tutorial, you will use the Appery.io platform to build a mobile app. The tool set includes:

  • Ionic – native-like UI components
  • AngularJS – UI logic/binding
  • Appery.io App Builder – cloud-based drag and drop designer
  • Appery.io Backend Services – API backend for the app

Read the rest of this entry »

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

Posted: July 14th, 2015Author:

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 Customize Service Mapping with JavaScript

Posted: July 10th, 2015Author:

With Appery.io visual mapping editor, it’s very fast and simple to map data between the UI and REST API services:

REST API mapping

REST API mapping

There are cases where straight mapping might not be enough. In other words, you need to take data from the page and format it before making it input to a REST API. That’s exactly why the visual mapping editors allows to write JavaScript code — this allows you to customize the mapping as needed.
Read the rest of this entry »

How to Add Barcode Scanner with Database Search to Your App

Posted: June 29th, 2015Author:

We know that developers love examples. One of the most requested example is how to build an app with barcode scanner and search the database. We created an app example that does exactly that.

Screen Shot 2015-06-29 at 2.14.47 PM

Appery.io plugins

Read the rest of this entry »

How to Query a Database by Date

Posted: June 25th, 2015Author: and

Screen Shot 2015-06-25 at 1.28.03 PM

Selecting a date via a Datepicker component and querying a database by date is one of the most common tasks a mobile app will do. With Appery.io’s out-of-the-box cloud database and auto-generated APIs, querying the database is fast and simple.

Read the rest of this entry »

API Express: Expose SQL Databases with REST APIs

Posted: May 28th, 2015Author:

api_express_logo

Wondering how to access your SQL database from a mobile app? We’ve got the answer. API Express, recently released by Appery.io, can make your existing SQL database RESTful in minutes, allowing you to perform CRUD operations from any external source, whether it’s a mobile app or a web page.

Read the rest of this entry »