Tag Archives: REST API

Back to blog home page

Deep Dive Series: Integrating Backand with Ionic Creator, Mandrill & More

Posted by on Mar 14, 2017

Over the next several days, we’ll be running a set of deep-dive blog posts. Each post will cover a different topic in-depth, providing a deeper look at integrating Backand into a number of different application development scenarios. The posts will cover three differing topics, showing a range of functionality that can be implemented into a serverless app. A brief overview of each topic is provided below, to serve as a reading guide.

Integrating Backand with Ionic Creator

Ionic Creator is a powerful online development environment for Ionic apps. While it provides a convenient, UI-focused means for implementing a multi-platform application, it can make some tasks – such as integrating with a third-party service provider like Backand – challenging. In the article on integrating with Ionic Creator, we’ll cover the steps necessary to get Ionic Creator working with our new SDK. By following the steps in this article, you’ll be able to make your apps truly portable through the use of our serverless platform and Ionic’s core offering of cross-platform capable and consistent user interfaces.
Read more

Sending Email Attachments with Mandrill

While we can easily send email messages over MailChimp’s Mandrill API with simple HTTP calls, any message that includes an attachment needs to be created on the server side. In the Mandrill Attachments article, we’ll cover the process for creating a Node.JS Server-Side JavaScript action that can add an attachment to a transactional email sent via Mandrill. We’ll cover the JavaScript code you need to fetch a file from the web, convert it to a format Mandrill can accept, and then initiate the message send.
Read more

Batch and Bulk Processing in Backand

Backand’s automated REST API generation provides developers with a significant amount of functionality right off the bat, allowing your app to quickly begin working with the objects represented in your application’s database. However, these APIs are limited to working with a single record or retrieving a list of records. If you wish to create multiple records at once or update several objects across multiple database tables in a single API call, then you’ll want to make use of our bulk processing API. We’ll provide all of the details you need to create bulk processing requests, allowing you to easily update large numbers of records in your application’s Backand database.
Read more

Other topics

We’re always looking to help developers understand how to better work with the Backand platform. Our goal is to make developing your app easier, and we’d love to hear from you if you have an idea that would help us achieve that goal. Simply contact us via social media, or using our contact form to start a conversation!

Back to blog home page

Upgrade Your Apps to Work with Our New Serverless SDK

Posted by on Mar 02, 2017

This post is a quick guide to upgrading your existing Backand-powered applications to work with the new Backand Serverless SDK we announced a couple of weeks ago. We’ll cover the changes made in the SDK, and explore the steps you need to take to get your Backand application up and running with the new API.

What’s changed?

We’ve made a number of changes in our new SDK that make developing against Backand faster than ever. Here’s a brief overview of what changed:

  • Streamlined authentication, making it easier for you to authenticate your users.
  • Improved the process for registering with – and signing in via – social media providers with the addition of new SDK methods.
  • Greatly improved the method in which you interact with Backand objects. Gone are the days of needing to manually construct a URL – simply specify the object name as part of a clearly-named function call to the API, and we handle the complexity for you.
  • We have also streamlined our response data, allowing you to work with the results of calls to your Backand back-end in a more straightforward manner.

And on top of all this, we continue to offer the same secure, scalable, and responsive backend-as-a-service that we always have!

Converting old app code to the Serverless SDK

Next, let’s look at what steps are needed to change a Backand application to work with the new SDK. For reference, we are basing this code off of our base Ionic starter app – see it on the Ionic marketplace at https://market.ionic.io/starters/backand-simple.

Step 1: Add new SDK to bower.json

First, you’ll need to add the new SDK to your bower file.

Step 2: Update Script includes in index.html to include the new SDK.

Start with removing the old SDK by commenting out – or deleting – the following line:

Then, replace it with the new SDK links:

Or, use the CDN files:

Note: You may want to check your dependencies directory for any lingering versions of the old Backand SDK – this can cause cache issues due to competing HTTP Interceptors. Simply remove the old folder from the appropriate directory in your project.

Step 3: Update the user authentication method

User authentication is largely unchanged, with a few notes below:

  • If you have previously disabled anonymous auth in your app, you can re-enable it using Backand.useAnonymousAuth(). This value defaults to true, so if you do not modify the default value you do not need to make any changes.
  • We’ve added new social media authentication functions: socialSignin, and socialSignup. Please note that while some of the examples in our github repos – and some of our documentation – used socialSignUp to refer to the specified function in the Backand SDK, this is no longer valid – the “up” will not be capitalized in the new SDK.

Step 4: Update the method used to detect unauthorized users

The getToken() method has been expanded, to use a promise. Originally this method would return undefined when a user was unauthorized, but this functionality can now be managed via the promise method. In the new SDK, the getToken() method is not as prominent as it was in previous versions, and you are likely to not need it as you work on your app.

Step 5: Change $http usage to use the Backand SDK REST methods:

The Serverless SDK features wrapper methods that can be used in place of the direct HTTP calls used in the previous method. Here’s a quick comparison of the old SDK’s HTTP communications, as compared to the new function-based Serverless SDK:

Step 6: Update data result usage

The old SDK would use code similar to the following when handling responses from Back& API calls:

The new SDK does not store the results in a nested data member, but rather in a root data element. The old SDK stored the response contents in a root property, meaning that the actual data was a subset of this data property – hence the use of result.data.data in the old SDK. With the new SDK, you no longer need the extra level of disambiguation, and can store the data in your application’s object with the following code:

Conclusion

In this post, we covered the Backand Serverless SDK. We touched briefly on the features the new SDK has to offer and walked through the process necessary to convert an existing Backand-powered app to the new API. Most importantly, though, is that we built this SDK based on your feedback, and we want more! Connect with us via social media (Twitter, Facebook), or on StackOverflow, or even directly via comments on our Git repos and contacting customer support – we’d love to incorporate your thoughts and suggestions into the next version.

Don’t have a Backand account? You can get one for free

Back to blog home page

Using Backand with PHP

Posted by on Aug 19, 2015

PHP is one of the most common server-side programming languages, as evidenced by the popularity of WordPress and MediaWiki, for example.

Backand provides a Backend as a Service (BaaS) by automatically constructing a REST API for a database schema specified as a JSON. It is natural to interact with your Backand data from PHP through the Backand REST API.

Continue reading

Back to blog home page

How to Reduce Risk in Web Development

Posted by on Apr 07, 2015

Web development can be an inherently risky endeavor. While the costs to get up and running with a development environment are almost non-existent, every choice you make as you build your application has long-term effects on your technology stack, your application’s performance, and the expertise available to you as you build a development team. Below we’ll look at a few strategies for reducing the risk inherent in web development. Applying these strategies may add some additional effort up front, but in the long run will reduce the total cost of ownership of your application and provide you a lot of flexibility when it comes to finding solutions to development and deployment issues.

Continue reading

Back to blog home page

BYOD – Bring Your Own Database

Posted by on Feb 11, 2015

It can be tough to gauge migration efforts when evaluating Backend-as-a-Service (BaaS)  providers. If you are building a brand new web application, you are usually not particularly concerned with the costs to migrate to the new application infrastructure. However, if you have an existing application that you are porting to a new provider, you’re faced with a problem: what do you do with your data? Below we’ll look at the core challenges in migrating to providers like Firebase and Parse, and then evaluate a different approach to data as presented by Backand.

Continue reading

Back to blog home page

Does AngularJS Meet Enterprise Security Needs?

Posted by on Jan 20, 2015

A significant portion of the AngularJS development community is focused on so-called “greenfield” development – new apps built against an essentially empty database or a new concept. While this is a common way to implement a new Angular app, it ignores a lot of the benefits that existing applications can reap from transitioning to an Angular-focused development environment. Below we’ll look at some of the concerns faced by enterprise customers converting to Angular, and how they can be mitigated.

Continue reading

Back to blog home page

Are Frontends Getting Smarter?

Posted by on Jan 13, 2015

Traditional web development wisdom holds that a firm separation should be maintained between the frontend display code and backend server code. However, this often increases the costs needed to deploy and maintain a web application. As usage of the application increases, the server side processing quickly becomes a bottleneck with each request taking up additional limited resources. There are multiple standard solutions to this, but typically they involve an increase in server hardware – along with associated costs.

Continue reading

Back to blog home page

To Code or Not to Code

Posted by on Dec 08, 2014

When developing a front-end for an existing application, one of the first questions that often arises is “How should we build this?” Choosing to write custom code to solve a problem can give you a lot of flexibility in the end product, but ultimately will end up causing a lot of money and time for development and ongoing support. In some cases, it makes more sense to try to abstract the development process as much as possible, minimizing the amount of code to be written. In this article we will look at a number of ways to approach building an application on top of existing data, and why you might choose one over the other. We’ll also touch upon the related front-end code, particularly looking at cases where a directive-driven approach like AngularJS can be used efficiently and effectively.

Continue reading

Back to blog home page

How to Build Dynamic Forms in Angular Directive with a Backend

Posted by on Oct 02, 2014

In this blog we will demonstrate how to build dynamic forms in Angular with a backend, that in the end will return the configuration and data.  This code was created for anyone who needs to build a complex project with many forms.  To demonstrate the server side we will use Backand’s REST API in addition to referencing the full code in GitHub.

Continue reading