Back to blog home page

Hosting and Deployment of Your AngularJS App

Posted by on Dec 15, 2015

There is a wide range of options for hosting and Angular app. If your app is primarily client-side, there’s no need for a  powerful server – a recurring cost that is a hindrance to app development. Luckily, Backand gives you a secure, reliable, and high-performance hosting environment for your application.

And the best part, to celebrate the holiday season and the new year,  we’re giving you your first 12 months free! (limited to 10GB of storage and 500GB/month of data transfer).

Below we’ll look at the features offered by Backand Hosting, and see how they can be integrated into your project.

Why Provide Our Own Hosting?

Traditional web apps, with a back-end such as Rails, Django, or Node, require a computer’s full capability to process the logic, as well as render the resulting pages to the server. However, if you are utilizing a Backend-as-a-Service such as Backand, then you don’t necessarily need the complexity of a fully-featured web server. As AngularJS applications built against Backand have much of the processing load taking place in the client browser, Backand created a secure, reliable, and high-performance hosting solution that you can start using immediately, letting the world have access to your Backand-powered app.

Hosting Features

Backand provides a number of capabilities:

  • Backand sets up SSL encryption for your application, securing your communications without your having to spend hours hunting down an SSL certificate.
  • Backand Hosting offers a Content Delivery Network (CDN), allowing you to provide high availability and performance
  • Backand offers custom domains, allowing you to brand and represent your application however you like.

With these tools, and Backand’s RESTful back-end, you have everything you need to create a stand-alone, secure and high-performance AngularJS application.

Deployment From the Command Line

Hosting is, of course, only half of the problem. You need some way to get your app’s files deployed on your server, so that the latest and greatest features can be accessed by your users. Backand provides several tools for managing deployments, taking what used to require hours of custom Bash scripting and turning it into a one-line command.

The first deployment method is via the Backand Command-Line Interface (CLI). The CLI is a Node.JS package, deployed with Node Package Manager (NPM), which provides you with command-line tools to manage your application’s deployments. Simply install Node.JS (which also installs NPM), then install Backand’s CLI tool using the following command:

Once you’ve installed the CLI, you can quickly deploy your project from the command line using the following:

Simply replace each component in angle brackets (<>) with the appropriate data for your application, and you are all set!

Deploying Using GulpJS

The Backand node package also gives you tools to control deployments with GulpJS. To enable Gulp integration with Backand Hosting, start by installing the node package “backand-hosting-s3” as follows:

Once you’ve installed this additional package, you will need to require the sync module for Backand. Add this line to the top of your app’s gulpfile.js:

Next, create the task. Simply add the following task to your gulpfile, and substitute your app’s information as necessary:

Finally, we need to tell Gulp to sync the “./src” folder in order to get the code to deploy correctly. Update your gulpfile with the following:

And with that, you’re ready to deploy with Gulp!

Conclusion

Backand Hosting provides reliable, secure, and high-performance hosting for AngularJS applications. With all of the features you expect from a fully customizable host, and easy deployment from either the command line or an existing build process, Backand Hosting can close the loop on your application’s lifecycle by providing you custom hosting and deployment – all in one place. For more information, check out Backand’s documentation.

If you don’t already have a free-forever Backand account, or to login to your existing account — Signup to Backand.