Skip to main content

Configuring Functions

The photoniq.toml file allows you to configure settings such as CORS, logs, and environment variables for your functions, enabling function-specific customizations.

Here is an example of the default photoniq.toml file:

photoniq.toml

name = "testRustfunction"
version = "0.0.1"
description = "Description for function testRustfunction"
lang = "rust"
#execute_url_suffix = "optional_url_suffix_to_execute_function"

[cors_settings]
allowed_methods = ["GET","POST"]
allowed_hosts = ["macrometa.com"]
allow_http = true

[log_settings]
enabled = true
level = "INFO"

[env_vars]
MESSAGE = "Hello 👋! This message comes from an environment variable"

The table below describes the settings in the the photonIQ.toml:

FieldDescription
nameThe name of the function.
versionThe version of the function.
descriptionA brief description of the function.
langThe programming language used to write the function.
execute_url_suffixAn optional URL suffix used to execute the function.
[cors_settings]Configuration settings for Cross-Origin Resource Sharing (CORS).
cors_settings.allowed_methodsHTTP methods allowed for CORS.
cors_settings.allowed_hostsHosts allowed to access the function.
cors_settings.allow_httpBoolean indicating if HTTP is allowed.
[log_settings]Configuration settings for logging.
log_settings.enabledBoolean indicating if logging is enabled.
log_settings.levelThe log level (e.g., INFO, DEBUG).
[env_vars]Environment variables used by the function.
env_vars.MESSAGEAn environment variable containing a message.