Configs
Config example
I will explain every config bellow the example.
fields
Fields are loaded by default in the main.js file. You can customize the Fields file "./src/templates/Fields.js" or create a new one. This file contains elements such as form fields and is utilized by the form builder. Note that the form builder will not function without the components. However, if your application does not utilize any forms, you can manage without it. In such cases, you can remove fields from the configuration entirely, thereby reducing the size of your application.
helper
The helper config allows you to pass all third-party library functions to your routes, controllers, views, and components. This enables you to easily utilize these functions by initializing them in one central location and then distributing them throughout the app.
The helper config accepts any data type
, but it's highly recommended to structure it as a function that returns an object containing the expected libraries, like bellow.
ready
This will be triggered once the main Startox view has finished loading.
request (Fetch API library / ajax)
Read more about ajax in the Ajax Integration section.
url: The URL to your site/API location to access via Ajax.
dataType: Set expected response data type
json
,xml
ortext
. Json response will be converted toobject
, xml toDOMParser
and text will be text. (default: json)path: Extends the URL with a URI path. (optional)
startPath: Adds a default start path if the URI path is empty. (optional)
config: Supplies the fetch request with options. You can read more about these options here. (optional)
get: Passes custom or modifies a GET parameter for the controller result. (optional)
post: Passes custom or modifies a POST parameter for the controller result. (optional)
Last updated