left-icon

Aurelia Succinctly®
by Matthew Duffield

Previous
Chapter

of
A
A
A

CHAPTER 19

Deploying

Deploying


In this chapter, I am going to walk you through taking your application and bundling it, then deploying it to GitHub or Bitbucket pages so that you can see it running. The steps required to do this will not be exactly the same as you would do for production on one of your own servers, but it should be close enough to give you a starting point.

The steps that we are going to follow should work for both GitHub and Bitbucket repositories. Before we start, it is recommended that you have two repositories: one repository that stores your source code for development, and another repository that only contains your bundle for deployment. The following steps assume that you already have a development repository set up. Let’s get started:

  1. Create a user account on GitHub or Bitbucket, if you don’t already have one.
  2. Create a deployment project.
  3. Clone this new project to your development machine.
  4. In your existing project on your development machine, execute: npm run build
  5. From the dist/ folder, copy its contents to the new project: cp ../<project name>/*
  6. In your terminal window in the new project, add the files using Git.
  7. Commit your changes to the new project.
  8. Push your changes to GitHub or Bitbucket.
  9. Test your application by navigating to:
  1. For Bitbucket: http://<user account>.bitbucket.org
  2. For GitHub: http://<user account>.github.io

This will come in handy when you are simply trying to test your application and you want it pushed somewhere easy and free, but without a lot of ceremony.

Here are links to GitHub and Bitbucket in case you run into any issues.

Remember, you can only have one set of pages per user account. Also, this only works if your code is front-end only. If your project has both client and server mixed together, then you may need to do some additional work.

Deployment security

We have been focusing on building applications using Aurelia. At some point, you will be deploying your solution to the web, and end users will view the application through their browsers. It is important keep your source code secure and try to mitigate third parties from copying your source code and throwing up their own solution. Here are a few points to take into consideration when deploying your solution:

  • Never deploy your source files. Always bundle your application.
  • Even if you bundle your source files, always ensure you have minified your bundle as well.
  • If you want to further obfuscate your source, consider looking at jscrambler.
  • Aurelia has working server-side delivery of pages and content; consider using this technology, and only load content as you need it.
  • If you are using third-party services or tools, never store your user accounts, IDs, or passwords in your source code.
  • Consider configuring your server to host your application using HTTPS.
  • If you are enabling CORS on your server, do not configure with wild cards for any access.
Scroll To Top
Disclaimer
DISCLAIMER: Web reader is currently in beta. Please report any issues through our support system. PDF and Kindle format files are also available for download.

Previous

Next



You are one step away from downloading ebooks from the Succinctly® series premier collection!
A confirmation has been sent to your email address. Please check and confirm your email subscription to complete the download.