Skip to content

src backend services config

KernelDeimos edited this page Jun 11, 2025 · 1 revision

Service Configuration

To locate your configuration file, see Configuring Puter.

Accessing Service Configuration

Service configuration appears under the "services" property in the configuration file for Puter. If Puter's configuration had no other values except for a service config with one key, it might look like this:

{
    "services": {
        "my-service": {
            "somekey": "some value"
        }
    }
}

Services have their configuration object assigned to this.config.

class MyService extends BaseService {
    async _init () {
        // You can access configuration for a service like this
        this.log.info('value of my key is: ' + this.config.somekey);
    }
}

Accessing Global Configuration

Services can access global configuration. This can be useful for knowing how Puter itself is configured, but using this global config object for service configuration is discouraged as it could create conflicts between services.

class MyService extends BaseService {
    async _init () {
        // You can access configuration for a service like this
        this.log.info('Puter is hosted on: ' + this.global_config.domain);
    }
}

General

API

Concepts

Types

For Contributors

Extensions

Devmeta

Planning

Self_hosters

Src

Backend

A_and_A

For Contributors

Features

Lists_of_things

Modules

Puterai

Notes

Services

Src

Modules
Puterai

####### For Contributors

Test_drivers

Gui

Phoenix

Tools

Api_tester

Uncategorized

Clone this wiki locally