Backend Server Configuration - AppDaddy-Software-Solutions-Inc/framework-markup-language GitHub Wiki

Overview

FML is backend independent, with a few very basic requirements needed for integration. FML generally uses a backend*, at least once to serve template files, at which point it will cache them for uninterrupted offline capability.

* One exception, FML Applications can be ran without a backend (and fully offline) but only as a stand-alone application and the template files must be included within the initial download. You can see our examples built into the windows/mac/android/ios versions by adding an application using the address file://applications/sample or file://applications/fmlpad with templates provided from the local files. At any point a local template can tell the application to call apis/templates from a backend across a network, this way you can start creating/using applications without having a backend initially.

Table of Contents

Getting Started / Backend Requirements

  1. Template Serving

    Web: The web domain will serve as an automatic prefix for all template references, if you wish to serve the template files from a server other than your web server you can set up an api to dynamically serve them. Mobile/Desktop: The frontend system needs a domain specified either in system.dart's defaultDomain or by allowing user to manually enter a domain with system.dart's AppConfig = AppConfig.MultiApp so it knows where to get templates.

    ex: Your application is hosted at https://fml.dev, all the templates are stored under your parent directory in a folder called templates (ensure the folder and all files have read access permissions). To open a template named faq call open('templates/faq.xml') which goes to https://fml.dev/templates/faq.xml

  2. Configuration Files

    The config.xml file must have read access and be placed directly in the parent directory, the FML application finds the config.xml with the domain setup from step 1, ensure your application knows where to point to for the backend. Once the application reads the config it is able to direct the application to the HOME_PAGE/DEFAULT_PAGE template.

  3. API Setup

    FML can call APIs with RESTful HTTP Methods and expect a 200 status code on success. If you wish to return data to a Datasource such as a GET it expects the data in XML or JSON format. You could also setup an API endpoint to return the templates rather than having the file stored under the service in a static folder, this can allow for templates to be hosted elsewhere or to dynamically build templates on the backend.

  4. Web Server (Only required for a web frontend)

    Setup a web server and ensure the root contains the required FML web build files, FML uses the standard index.html which calls our JavaScript to initialize the Web Application. The index.html can be edited to change the title, favicon, meta details, splash logo and to add or modify any custom html/js/css. Caution to not remove or modify any existing scripts included in the index.html. If you intend to develop on localhost you will need to configure the web service response headers allow origin to avoid CORS errors

config.xml

Please refer to the config.xml section of this wiki.

Documentation you may find useful

Authentication Template

⚠️ **GitHub.com Fallback** ⚠️