X
X

Login

Login if you already have an account

LOGIN

Register

Create a new account. join us!

REGISTER

Support

Need some help? Check out our forum.

FORUM

FYI – get all your data in one click from FatFractal


As a developer, I want to be able to export all my data (and I mean ALL my data) with one click so that I can do whatever I want to with my data, including moving to another provider – it is MY data after all.

I was asked by @objclxt a couple of days ago if he could export his data stored in FatFractal with one click. At the time, we had always generated an export of the data for customers upon request, which is fine, but not what developers want. When someone asks for functionality that I know ought to be there, I get a bit antsy, so I decided that I had put that important piece of functionality off for too long, promised Nick a 1-day turnaround, and set about it.

Twelve hours of coding and testing, eight hours of sleep, and then another 3 hours running our release candidate smoke tests later, the good news was that it worked – and so it was deployed to production.

How it works:

From the console list of your applications, you will now see a link that says “export my data”. When you click on it, you will see an alert that tells you that your data is being exported and you will receive an email with a link to a zip file with your data.

Note: the request requires authentication/ authorization for the application as does the export link in the email, which is both ephemeral and is of course an SSL link for security purposes.

So – we export a zip that contains a number of .json files (one for each of your collections with all of the object data that they contain). The object data also contains all the references to other objects, a collection for your GrabBag references, including BackReferences, and of course we also export all of your blob data in the export.

Give it a whirl and let us know what you think!

Gary

FYI – Queries that will make you smile! FatFractal’s natural language queries are very cool.


As a developer, I really want to be able to get the data back from my API in a single request so that my application performs better and I don’t get socked with excessive API requests that result from “chatty” APIs.

One of the things that developers love about FatFractal is the way that you can construct queries that can get you to what you want in a single round-trip.

First, the basics – FatFractal queries…

  1. …are written in an easy to create, easy to read, natural language style.
  2. …can be chained together to filter the results to only the results you want in a single request.
  3. …are able to “walk” your object graph in both directions.
  4. …provide the best of relational capabilities without the complexity.
  5. …are constructed as strings, not proprietary query objects.
  6. …includes a very useful random operator that for some reason, nobody else seems to offer.

Let’s say that you have movie Star, Movie and Theater objects and their respective collections (Stars, Movies and Theaters) and you want to get all the theaters that are showing movies that have a particular star acting in them within a defined distance from the user. The following explains how you can create a query string that can return that in a single request/ response to illustrate the power of nesting queries in a single construct:

/Stars/(firstName matches ‘(%3Fi)milla’ and lastName matches ‘(%3Fi)jovovich’)/BackReferences.Movies.stars/()/BackReferences.Theaters.movies/(distance (location, [57.5833, 3.8667]) lte 5000)?sort=rating desc, name asc&count=5&first=0

Creating or reading FatFractal queries goes left to right, with query constituents enclosed in parentheses with “traversals” and queries separated by forward slashes. So, breaking down the query above into pieces:

    /Stars/(firstName matches ‘(%3Fi)milla’ and lastName matches ‘(%3Fi)jovovich’)
    The first part (a query) will get the movie star(s) (Star object) from the Stars Collection with the firstName member ‘Milla’ and the lastName member ‘Jovovich’, using regular expressions that compare while ignoring case (requires proper encoding of the Java regex mode modifier ?i for ignore case to be added as %3Fi) and a boolean operator (and) to ensure a complete match. Note: we now have a set of Star objects, probably with a single object.
    /BackReferences.Movies.stars
    The second part (a traversal) will then get all the Movie objects that she starred in based on the BackReferences from the Movie objects in the Movies Collection to the star in the Stars Collection. Note: we now have a set of Movie objects.
    /()
    The third part (a query) is an empty query operator that says that will use the entire set returned by the traversal.
    /BackReferences.Theaters.movies
    The fourth part (a traversal) will then get the Theater objects from the Theaters Collection that are showing movies that Milla Jovovich starred in from the BackReferences from the Theater objects in Theaters Collection to the above set of Movie objects in the Movies Collection. Note: we now have a set of Theater objects, which is what we want.
    /(distance (location, [57.5833, 3.8667]) lte 5000)
    The fifth part (a query) will then filter that set of Theater objects by geolocation that are within 5 kilometers of the user.
    ?sort=rating desc, name asc
    The sixth part (a sort) will then sort them first by the rating member of the Theater objects in descending order, second by name member of the Theater objects in ascending order.
    &count=5&first=0
    Lastly, we then limit the result set of Theater objects to the first 5 items or less.

Summary:

So, basically we start from a Star object in the Stars Collection, walk the datagraph to Movies using a BackReference, then walk the datagraph again to Theaters using another BackReference, and then filter the set of Theater objects further based on location, order the results by both the rating and name member values and limit the number of responses to a specified maximum count. Voila – you get what you want, ordered as you want, all in one go with a single, easy to understand query – this simply cannot be done with any other BaaS provider.

Also, let me point out the random operator in the FatFractal query language as it is an example of a very common use case.

Let’s say you want to retrieve a random movie Star from the Stars collection. The query looks like this:

“/Stars/(guid eq random(guid))”

This is incredibly useful as otherwise, you would have to retrieve the entire set of Star objects from the Stars collection over the wire and then pick a random one from that set in your client code. Easy enough to program, but grossly inefficient in terms of client resources and network performance. Otherwise, you could *probably* retrieve a random item with two queries – first, by querying the collection to get a count, and if the API has an ordered ID (as many do), then you could generate a random ID in your client code and fetch that one (hoping that it has not been deleted). At any rate, getting a random object from a collection is a very common use case and I do find it bizarre that nobody else support this as easily as FatFractal does and forces you to use very inelegant client solutions.

One more point to make is that queries can be used in the context of GETS as well as within Server Extensions and Event Handlers.

All for now – have fun with your queries!

Kevin

For more information on FatFractal Query language, the docs are here.

For more information on how to write queries with FatFractal, the docs are here.

FYI – You can run batch routines (CRON) jobs on FatFractal


As a developer, I want to be able to schedule code to run periodically on my backend so that I can clean up my data, generate reports or any other function that is not generated by an event or API call.

In addition to Event Handlers which execute based on data events and Server Extensions that execute on an API call, FatFractal also supports running backend code on a periodic basis using our Schedule Code capability. Any number of functions can be defined that execute on defined schedules. This has many applications from data administration to reporting, there really is no limit to what you can do with this.

Scheduled Code is defined in the same manner as Event Handlers and Server Extensions in your FFDL (what’s this?). You can define as many scheduled code events to be executed as you wish very easily as follows:

SCHEDULE <task name> <schedule> AS <script type>:<script text>

Where schedule is given in CRON format:

<minute (0-59)> <hour (0-23)> <day of month (1-31)> <month (1-12)> <day of week (0-6)>

For example, if I want to send out a daily report that lists the number of users for my cool new app, I would create a function like this in a file (here called EventHandlers.js):

ff = require('ffef/FatFractal');
exports.userReport = function() {
var n = ff.getArrayFromUri("/FFUser").length;
var msgSubject = "Application user total daily report";
var msgString = "You now have " + n + " users loving your application";
ff.sendEmail({
host: "<mailserver>", port: "<port>",
auth: "<true|false>", authPort: "<port>",
username: "<username>", password: "<password>",
from: "<fromAddress>", to: "<toAddress>",
cc: null, bcc: null, // included for completeness
subject: msgSubject,
text: msgString,
html: null // included for completeness. When supplied, the HTML message is
// sent, the text is also included as fallback if HTML viewing
// is not enabled in the receiver's email client
});
}

And, then to schedule this be sent out daily at midnight, the FFDL would be:

SCHEDULE UserReport 0 0 * * * AS javascript:require(‘scripts/EventHandlers).userReport();

That’s it – an approach that is very consistent with everything else which allows you to easily schedule any code that you like to execute on a defined schedule.

For more details on FFDL, the docs are here.

For more details on Scheduled Code, the docs are here.

Have fun!

Kevin

FYI – FatFractal Server Extensions lets you extend your API with any function that you want


As a developer, I want to be able to add any function without limitation to my API so that I can… do just about anything!

As Gary mentioned in his post about the origins and future of FatFractal’s NoServer -

The cloud should… Not prevent me from doing anything else that I want to do”

Server Extensions are, essentially, a means to extend your API with any kind of function that you desire. Server Extensions accept data as needed, execute any code that you want and return a broad set of return types (JSON, HTML) allowing virtually unlimited capabilities for your backend. They are easy to create, and you can add as many as you wish.

What can I do with a Server Extension?

The uses for Server Extensions are very broad, but a few examples are:

  • Aggregate data on the fly without corrupting your data model.
  • Access other backend services (e.g. salesforce, sap, etc.), then transform/ return the results.
  • Data management/administrative functions.
  • Manipulate and return HTML, images, videos, documents or any other MIME type.

Extending your API

Accessing a server extension is as simple as naming it in your FFDL (what’s this?), which will provide URI access to this particular function.

CREATE EXTENSION /extension_name AS javascript:require (‘scripts/MyExtensions.js’).function_to_be_executed();

This will add a new URI endpoint to your application that looks like:

https://mydomain.fatfractal.com/ff/ext/extension_name

When that URI is called, the function function_to_be_executed that is in the file MyExtensions.js in the ff-scripts directory will be called. Any provided parameters or data are made available to the function as well. You also have the option to declare the function to be secured (default) or add UNSECURED which allows a non-authenticated user to call the function as desired.

Passing in Data

There is a wealth of data from a request that is made available to a Server Extension, including:

httpMethod: the HTTP method (eg. GET, POST, PUT, DELETE, HEAD)
httpRequestUri: the request URI, relative to your application’s base URL
httpParameters: A map of the request parameters
httpHeaders: A map of the request headers
httpCookies: For convenience, a map of the cookies from the Cookie request header
httpContent: A map corresponding to the JSON content supplied in the request body, if any
ffUser: the guid of the logged-in user

This means that you can process according to the httpMethod used, pass in data as httpContent or as URL parameters and authenticate based on the user making the request – in short, you have a lot of flexibility on getting what you want into a Server Extension.

Return Types

You also have control over what gets returned by the extension, including the following:

result: the data or content that you wish to return
responseCode: the appropriate http response code
statusMessage: an informational status message useful for debugging
mimeType: the MIME type of the response content

One of the most useful abilities that Server Extensions provide is the additional return MIME types that are supported. For example, you could create an image resizing service and set the MIME type of the return (e.g. “image/jpeg” or “image/png”). Or, you could read an html template file, replace elements to personalize it and return a web page (“text/html”). And, of course, you can always return data as well (“application/json”), which is the default.

You can also implement as much error handling as you want based on what data is received as well as the result of the operation itself. For example, checking for required information and returning an appropriate error code with a message that you want.

The following example of an extension that validates a user registration from a link shows a number of these features in use:

exports.verifyRegistration = function() {
var data = ff.getExtensionRequestData();
var hc = require('ringo/httpclient');
var r = ff.response();
// check if user guid provided
var guid = data.httpParameters['guid'];
if (! guid) {r.result = null;
r.responseCode = "400";
r.statusMessage = "ActivationRequest guid not supplied";
r.mimeType = "text/html";
return;
}
// check if activationRequest exists
var activationRequest = ff.getObjFromUri("/ff/resources/ActivationRequest/" + guid);
if (! activationRequest) {
var htmlContent = hc.get(ff.getHttpAppAddress() + '/validateuser.html').content;
htmlContent = htmlContent.replace("___SUBJECT___", "ERROR");
htmlContent = htmlContent.replace("___MESSAGE___", "The validation request for this account no longer exists. ";
htmlContent = '' + htmlContent;
r.result = htmlContent;
r.responseCode = "404";
r.statusMessage = "ActivationRequest could not be found";
r.mimeType = "text/html";
return;
}
// check if user exists
var user = ff.getUser(activationRequest.userGuid);
if (! user) {
r.result = null;
r.responseCode = "404";
r.statusMessage = "User could not be found";
r.mimeType = "text/html";
return;
}
// checks passed - now create the welcome html from a template and return
user.active = true;
ff.updateObj(user);
ff.deleteObj(activationRequest);
r.responseCode = "200";
var htmlContent = hc.get(ff.getHttpAppAddress() + '/validateuser.html').content;
    htmlContent = htmlContent.replace("___SUBJECT___", "Thank You!");
htmlContent = htmlContent.replace("___MESSAGE___", "Your account has been activated.";
htmlContent = '' + htmlContent;
r.result = htmlContent;
r.statusMessage = "User now activated";
r.mimeType = "text/html";
}

Hope you find this useful…

Kevin

For more information about Server Extensions, see the docs here.

For more information about FFDL, see here.

FYI – FatFractal provides an amazingly flexible event model for your business logic (when foo changes, do bar)


As a developer, I want to be able to create business logic for my backend using a language that I am familiar with so that I can quickly implement my solution without having to learn something new.

I must confess that this is one of my favorite things about the FatFractal platform. Essentially this involves an amazingly simple method for creating business logic on your backend and I hope that you will find the freedom and flexibility as convenient and useful as I do.

Business Logic

I am used to creating object classes on my backend, and then writing lots of inline business logic to manage my objects (data). I would create actions like createOrder within which I would do all kinds of things like validation, notification, etc. within each one. All fine, but requires lots and lots of code, a lot of discipline to ensure consistency as well as to avoid overloading any particular function with too much cruft.

So now, Backend as a Service provides good CRUD methods making it easy to persist your data to the backend, but most leave a * huge * amount to be desired in terms of implementing business logic on the backend, relegating the developer to dealing with in the client code causing bloat, poor performance and data reliability concerns.

Maybe there is a better way…

As Gary writes in his blog about the origins of NoServer -

“The cloud should:

  • Store and retrieve my objects.
  • Securely – permissions and security should be robust and at a fundamental level.
  • Efficiently – with easy to create queries that get me what I want.
  • Execute code on the backend when my data changes (events).
  • Not prevent me from doing anything else that I want to do.”

Event Handlers/ User Stories

With FatFractal’s Event model, I am now free to define discrete pieces of functionality that are bound to events generated as my data “changes”. All together, they define my business logic for my application backend much easier than ever before.

This means that I need to think about things differently in terms of how I architect my code. The good news is that, if you are a fan of user stories as I am, then this you will find it interesting that this maps really well for those that can be implemented on the backend. You can literally implement one-for-one against user stories. It also means that I can implement my business logic with amazingly little code – very cool!

For example:

As the administrator of foo, I want to make sure that all requisite info is present before I store an Order so that I do not have a lot of zombie orders in my data.

exports.validateOrder = function() {
var order = ff.getEventHandlerData();
if (!order.amount || (order.amount <= 0) {
throw {statusCode:400, statusMessage:'An order amount greater than zero is required'};
}
}

As a vendor, I want to be alerted via email when an Order greater than $5000 is received so that I can be glad that I started this business afterall.

exports.alertBigOrder = function() {
var order = ff.getEventHandlerData();
if (order.amount >= 5000) {
var user = ff.getObjFromUri("ff/resources/FFUser/" + order.createdBy);
var name = user.firstName + " " + user.lastName;
var msgSubject = "Woo Hoo - you got an order for " + order.amount;
var msgString = "Order " + order.amount + " was created by " + name;
        ff.sendEmail ({
            host: "<mailserver>", port: "<port>",
            auth: "<true|false>", authPort: "<port>",
            username: "<username>", password: "<password>",
            from: "<fromAddress>", to: "<toAddress>",
cc: null, bcc: null, // included for completeness
            subject: msgSubject,
            text: msgString,
html: null // included for completeness. When supplied, the HTML message is
// sent, the text is also included as fallback if HTML viewing
// is not enabled in the receiver's email client
        });
}
}

Controlling your Event Handlers with FFDL

You have complete control over how these events are handled (SYNC (PRE or POST), ASYNC) as well as the order in which things are executed using FFDL (what’s this?). So to define the two functions above in your FFDL, you just add the following:

CREATE HANDLER validateOrder PRE ON /Order CREATE AS javascript:require (‘scripts/MyEventHandlers.js’).validateOrder();
This means that the validateOrder() function will be called when a new order is Created, but before the Order is actually stored (PRE). This ensures that the order has all the requisite info and prevents storing zombie orders.
CREATE HANDLER alertBigOrder ASYNC ON /Order CREATE AS javascript:require(‘scripts/MyEventHandlers.js’).alertBigOrder();
This means that when a new order is Created, an alert will be sent via email Asynchronously, but only after the PRE event is cleared.

So – there you have it! Events makes it really simple to visualize and implement your business logic with simple functions that are easy to create and maintain. While this makes it really easy to do many, many things – there are some things that need even more, and that is where Server Extensions come to bear. Will post about those soon.

Happy coding!

Kevin

For more information about Event Handlers, see here.

For more information about FFDL, see here.

See Gary’s blog post about the origins of NoServer here.

PaaS? BaaS? What?

Lots of people ask about the origins of NoServer, which is what we call FatFractal’s BaaS module.

We were in the process of building out our cloud fabric and one night, while building yet another demo app, I decided that all developer-centric cloud platforms really also ought to offer a way for developers to get 90% of what they need for the server-side of their app, out-of-the-box, while also trying to ensure that we not fence them in – i.e. give lots of functionality with minimum effort whilst also giving flexibility and extensibility to go beyond the box as you reach the edges of what is initially provided.

The 90% boiled down to the following. The cloud should:

  • Store and retrieve my objects.
  • Securely – permissions and security should be robust and at a fundamental level.
  • Efficiently – with easy to create queries that get me what I want.
  • Execute code on the backend when my data changes (events).
  • Not prevent me from doing anything else that I want to do.



The last point is really important! Whilst getting the other things makes my life a lot easier and will make me very happy for a month or two, if the flip side is that I then get stuck and as a result get frustrated and miserable, then I wouldn’t want it. So by June 2012 we had built enough to trial with customers – who loved it! – we launched our public beta in September, worked through the kinks in Oct-Dec :-) and we are now really focussed on getting the word out.

Meanwhile, some new marketing terms were emerging from other similar, but essentially different approaches. Platform as a Service (PaaS) and Backend as a Service (BaaS) are now terms that are used widely.

Upon reflection, it seems to me that they are both missing the point. PaaS is still very focused on a historical view of a set of IT problems, i.e. “stacks”. BaaS is seeking to provide more of a turnkey solution for application developers that treats the backend as a black box and is extremely limiting, invasive and prescriptive (smells like attempts at lock-in to me).

IMHO – what the market needs is a bit of both: a very smart cloud fabric that deals with infrastructure, monitoring, scalability, reliability, resilience etc, and also provides the ease of creation and out-of-the-box features that BaaS does, but does not limit the developer as a result. If I want to deploy some Java Code, Ruby Code or anything else in order to do something that I want to do, right alongside my “BaaS” stuff, then I should be able to.

So – in a nutshell, what we have so far built into NoServer is:

  • True fully qualified REST URIs
  • CRUD persistence
  • SDKs that operate at the data level and do not encroach into your code unnecessarily.
  • Amazingly straightforward modelling of your object graph’s relationships
  • Natural language, chained queries nested as deep as you want.
  • Strong authentication. SSL of course. Declarative access controls for your data which is sufficient for almost all use cases while also providing programmatic control (directly setting ACLs on objects) for when the declarative approach isn’t enough (which, so far, has been incredibly rare)
  • Exposed CRUD events with defined Event Handlers that execute your custom JavaScript code when they occur with synchronous (PRE or POST) as well as asynchronous modes. Currently we use RingoJS which allows you to do pretty much anything you need to do, including make HTTP requests; we also supply an API for sending Apple/Android push notifications, sending emails, image processing, and of course full access to your app’s datastore.
  • Server Extensions that allow you to extend your API with whatever server-side processing you want, and the ability to schedule scripts to run whenever you like



We’re pretty flexible at the server-side already, and I think you’ll agree we’re already better than (or *at least* as good as!) our BaaS competitors, but there’s lots more to come. Here’s a list of some of what’s coming over the next six months or so!

  • Greatly enhanced and pluggable authentication framework so that you can script integration with pretty much whatever 3rd-party identity / authentication cloud you like
  • Event Handlers for GET requests, and ‘virtual’ collections
  • Allowing mix and match of the powerful declarative access controls we already have with your own javascript for the really really edge cases (like, only allow access to this object if the current user lives in Idaho)
  • Enabling integration between NoServer and Rails backends. This is a big step towards completing our vision – i.e. if you reach the limits of what NoServer provides, then you should be able to extend your backend with some Ruby-on-Rails, or Java servlets, or NodeJS, or whatever
  • Allowing use of NodeJS modules in your NoServer server-side scripting

  • Full support for NodeJS applications on the FatFractal PaaS, and integration between NoServer / Node / Rails / Servlets modules in your app’s backend
  • And last, but definitely not least – and probably the most personally exciting to me given where I have spent a lot of my working life (i.e. large enterprise IT) – we will be working on evolving our products so that they can be leveraged by enterprises. More on that when the time comes :-)



I hope that you like what we have built – would very much appreciate your feedback.

Cheers,

Gary

In case you’re curious – NoServer is a tribute to the no-stuff (chamber, room, globe, ship) in Frank Herbert’s most excellent Dune series.

FYI – With FatFractal you can send text or html emails programmatically using our JS Server-side SDK.

As a developer, I want to be able to easily send emails from my backend so that I can validate users, create email reports and alert others to important information


There are many use cases where sending an email from your application backend. One is to notify someone when some data has changed. Another is for the purposes of validating a user. This post will cover how to do both with your FatFractal backend.

Text-only emails

The sendSMTPEmail method (docs) will send text-only email messages from an account that you specify. For example, if you want to send a notification email to alert you when a new object is stored – say an Order, is received by your app.

First, define an EventHandler (what’s this?) as follows that will extract info from the new Order object, get some additional information from your backend and the create a notification email to whomever you want to alert them that a new order was created. This should go in a file in the ff-scripts directory that was created when your app was created (more about this), in this case we will call it EventHandlers.js.

function notifyNewOrder() {
var order = ff.getEventHandlerData();
var user = ff.getObjFromUri("ff/resources/FFUser/" + order.createdBy);
var name = user.firstName + " " + user.lastName;
var msgSubject = "New Order notification";
var msgString = "Order " + order.amount + " was created by " + name;
ff.sendSMTPEmail("<mailserver>", "465", "true", "465", “<username>”, “<password>”, “<fromAddress>”, “<toAddress>”, msgSubject, msgString);
}

In your FFDL (what’s this?), you then define your EventHander like this:

CREATE HANDLER notifyNewOrder ASYNC ON /Order CREATE AS javascript:require (‘scripts/EventHandlers.js’).notifyNewApp();

HTML emails

The sendEmail method (docs) accepts a set of parameters and will send your html content via an email account that you specify. For this example, we will use a slightly more complicated example – we will send out

function sendWelcomeEmail() {
var user = ff.getEventHandlerData();
var subject = “Welcome to Foo - we are so glad you joined us”;
var html = getHtmlWelcomeMessage(user);
try {
var emailData = {
host:"<mailserver>",
port:"<port>",
auth:<true/false>,
authPort:"<port>",
username:"<username>",
password:"<password>",
from:"<fromAddress>",
to:user.email,
subject:subject,
text:text, html:html
};
emailData = JSON.parse(JSON.stringify(emailData));
ff.sendEmail(emailData);
} catch (error) {
throw "Caught exception: " + error + " while sending email";
}
}

And, include the FFDL for this EventHandler as well.

CREATE HANDLER validateUser POST ON /FFUser CREATE AS javascript:require (‘scripts/EventHandlers.js’).sendWelcomeEmail();

The above makes use of a function called getHtmlWelcomeMessage which fetches a template HTML file that I have included in the webapp directory of my app, replaces marked elements with personalized content and returns the HTML content using the http client that is available to your server side js code.

function getHtmlWelcomeMessage (user) {
var hc = require('ringo/httpclient');
var htmlMessage = hc.get(ff.getHttpAppAddress() + '/welcome_email.html').content;
htmlMessage = htmlMessage.replace("___FIRST_NAME___", user.firstName);
htmlMessage = htmlMessage.replace("___LAST_NAME___", user.lastName);
return '' + htmlMessage;
}

That’s it – super easy to send email content to your users or for internal notifications/ reports or whatever you want!

Happy coding!

Kevin

For more details about FFDL, the documentation is here.

For more details about the Server-side JS SDK, the documentation is here.

For more about EventHandlers, the documentation is
Event Handers Reference

FYI – FatFractal can host your web content as well as your data API

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:

https://your_domain.fatfractal.com/your_application/your_content

DNS Settings

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:

https://your_domain.fatfractal.com/your_application/your_content

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 50.17.255.197 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”
map=”theurlyouwant.com”>
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.

Kevin

Contact