As the developer of mobile and web browser based apps, I want a backend that supports both web content as well as my data API
Mobile is hot and we love it! There are, however many times that you need web content as well as a data API for your apps.
With FatFractal, you have the choice of hosting web content somewhere else and using Cross Origin Resource Sharing (CORS) to allow those pages to access your data API in a browser – or – you can add your web content to your application structure delivered via the FatFractal cloud fabric together with your data.
So – here are the options for your webpage content…
Option 1 – Cross Origin Resource Sharing (CORS) between two hosts:
To enable CORS, all you need to do is edit the SET CORS in your application’s FFDL file to authorize another domain to access your backend in browser.
SET CORS https://anotherdomain.com
This will allow your web page to be hosted somewhere else to be access your data API from the FatFractal cloud.
Option 2 – Add your web content to your application footprint on the FatFractal cloud
When your application is scaffolded, we automatically create a webapp directory and you are free to add web content, subdirectories, css files, html files, js files, images, etc.
These will be served up as follows:
If your DNS provider supports domain forwarding/ masking, then you can configure your domain to “redirect” to the fatfractal url as above, but displays your domain in the browser. All that you need to do is set the forwarding url to:
Then, if you enable masking, your domain will always appear in the browser location bar.
Alternatively, FatFractal can also take care of this for you. This involves setting an A Record on your DNS (a host) with the IP address of 22.214.171.124 which will be the host for your web content.
Then, to let Fatfrctal know that you want to map requests from this URL to your web content, add this line to your context.xml file in the ff-config directory that is in your scaffolded application.
<context domain=”your_domain” name=”your_application” default=”true”More information on Cross Origin Resource Sharing is here.
More information on FatFractal URI structures is here.
More information on the FatFractal Description Language (FFDL) is here.