Skip to content

Configs.json

Marco Cusano edited this page Oct 14, 2023 · 2 revisions

Configs.json Example

{
    "installation": {
        "required": true
    },
    "database": {
        "host": "localhost",
        "port": "3306",
        "name": "pilot",
        "prefix": "prefix",
        "user": "root",
        "password": "root"
    },
    "schema": {
        "method": "include"
    },
    "applications": {
        "hash": "sha256",
        "datetimeFormat": "YYYYmmddHHiiss",
        "due_date": "3000-01-01 00:00:00"
    },
    "options": {
        "allowMultiApplications": false,
        "defaultEndpoint": "\/api",
        "defaultEndpointVersion": "v1",
        "enableAuth": false,
        "enableQuery": true,
        "locale": "en",
        "maintenance": false,
        "host": "http://localhost"
    }
}

Explanation of JSON Parameters

This document provides a detailed explanation of all the parameters present in the provided JSON structure.

installation

  • required: A boolean value (true or false) indicating whether installation is still required or not. If set to true, installation is mandatory; if set to false, installation is completed. Automatically managed by the installation.

database

All the following params can be managed during the installation:

  • host: The address of the database server. Here, it is set to "localhost," indicating that the database is located on the same machine.

  • port: The port on which the database accepts connections. Here, it is set to "3306," which is a common port for MySQL databases.

  • name: The name of the database to be used. Here, it is set to "pilot."

  • prefix: A prefix that can be added to all database tables. For example, if set to "prefix", tables will have names like "prefix_table1", "prefix_table2" etc.

  • user: The username used to access the database. Here, it is set to "root."

  • password: The password associated with the username for database access. Here, it is set to "root."

schema

That's a working progress feature that will be implemented in the future (maybe!) to reverse the "schema.json" rules.

  • method: The method used for schema management. Here, it is set to "include," which indicate that the schema inclusion or reverse-inclusion of the rules.

applications

Configuration params of the Authentication Token. Will be generated during the installation (required to execute any request).

  • hash: The hashing algorithm used for calculating data hashes. Here, it is set to "sha256," indicating that the SHA-256 algorithm is used for hash the token.

  • datetimeFormat: The format used to represent dates and times. Here, it is set to "YYYYmmddHHiiss," included in non-hashed key.

  • due_date: Here, it is set to "3000-01-01 00:00:00," which could indicate a very distant future due date of the default generated token.

options

  • allowMultiApplications: A boolean value indicating whether multiple applications are allowed. Here, it is set to false, suggesting that only one application may be allowed at a time. Still under development. "True" or "False" is irrelevant.

  • defaultEndpoint: The default path for API endpoints. Here, it is set to "/api." Which means that all API calls must follow the structure /api/{resource}.

  • defaultEndpointVersion: The default version of API endpoints. Here, it is set to "v1." Still under development. Changing this value will be actually irrelevant.

  • enableAuth: A boolean value that enable or disable the system to allows user authentication management through the Pilot Framework. Is still under development, so changing the boolean is irrelevant.

  • enableQuery: A boolean value that enable or disable the system that allows you to send queries to the route /api/query?query={yourQuery}, instead of passing through /api/pilot/{resources}. Here, it is set to true, indicating that queries can be executed on the route.

  • locale: The default response localization. Here, it is set to "en" (English). Only English lang is actually supported.

  • maintenance: A boolean value indicating whether maintenance mode is active. true will result in a single response by the Framework as following:

{
    "code": 503,
    "message": "Service Unavailable"
    "data": [],
    "error": "API Service under maintenance..."
}
Clone this wiki locally