Deploying a web application on top of FME Cloud: S3, DeployHQ, GitHub, CORS.

Overview

Often you need to create and deploy simple web applications that use FME Server for the back-end logic. If you have a web application that is just comprised of HTML/CSS with no server-side code, then this article provides you a suggested architecture on how to deploy such an application.

This deployment is based on how we deploy our web applications at Safe Software. We use four services to enable this: GitHub, AWS S3, Deploy, and FME Cloud. This is how they work together:

Step 1: Develop code

Write web application code and FME Workspaces and then push the code to GitHub. Safe Software now has a profile on GitHub where you can find all of the FMEpedia demos. Feel free to follow them and you will receive notifications when we update them.

Step 2: Auto deploy web code

This isn't a mandatory step, but it enables developers to very easily push code to AWS S3 (production web server). We use Deploy which is a web service that allows you to watch branches on GitHub. Whenever a developer pushes to the branch (in our case production) it automatically deploys those commits to AWS S3.

Step 3: Configure FME Server

The FME workspaces which the web application is using now needs publishing to the FME Cloud machine from FME Desktop. This is a very simple process, simply launch the FME Server publish wizard in FME Desktop.

You also need to configure the CORS on FME Server which allows web applications to access FME Server Web Services or the REST API on a different domain. This is always going to be the case with FME Cloud as the cloud instances are hosted on our domain and your web applications will be hosted on your domain. Details on how to configure CORS is available here.

Step 4: Configure Web Server

The key piece of this architecture is AWS S3 and the feature which allows you to host a staticwebsite. The AWS documentation is very clear and steps you through setting things up. A few things to consider:

You can use a custom domain rather than the random URL that AWS gives you. To do this you need to own a domain and you can then use Route 53 as your DNS provider. Steps on how to do this here.

It is recommended to use CloudFront to improve the performance of the website. CloudFront lets you, with a few clicks, deploy your website to AWS data centers all over the world. It dramatically increases page load times if your users are not all located in the same place. Details on setting this up here.