• Name: JSON File
  • Category: File

Configuration

Configu needs to be directed to your desired file by providing a file path via the path parameter.

Usage

.configu store declaration

stores:
  my-store:
    type: json-file
    configuration:
      path: path/to/file.json

CLI examples

Upsert command

configu upsert --store "my-store" --set "test" --schema "./start.cfgu.json" \
    -c "GREETING=hello" \
    -c "SUBJECT=configu"

Eval and export commands

configu eval --store "my-store" --set "test" --schema "./start.cfgu.json" \
 | configu export

Common errors and solutions

  1. File permission issues

    • Solution: Ensure that the application has read and write permissions for the specified JSON file path. Check the file system permissions and adjust them if necessary.
  2. Invalid JSON format

    • Solution: Verify that the JSON file follows the correct syntax. Use a JSON validator or parser to check for errors if you manually edit the file.
  3. File path not found

    • Solution: Make sure the specified path exists and is accessible. Create any necessary parent directories before attempting to read or write the JSON file.
  4. Encoding issues

    • Solution: Ensure the JSON file is saved with UTF-8 encoding to support all characters properly. If you encounter encoding problems, check the file’s encoding and convert it if necessary.

References