Skip to main content

Custom Configuration

The SDK automatically creates a [USER_HOME]/etc/kokos/[ME_ID]/[ME_ID].yaml file based on MicroExecutorConfiguration interface. You can extends it and execute a callback function before the server starts.

src/index.ts

import {
MicroExecutorConfiguration,
startServer,
startServerWithCustomConfig,
} from "@sme.up/kokos-sdk-node";

interface CustomMicroExecutorConfiguration extends MicroExecutorConfiguration {
// your custom properties
}
const defaultConfig: CustomMicroExecutorConfiguration = {
server: {
port: 8011,
},
logger: {
format: Format.JSON,
level: Level.INFO,
},
};

startServerWithCustomConfig<CustomMicroExecutorConfiguration>(
"[ME_ID]",
defaultConfig,
(config: CustomMicroExecutorConfiguration) => {}
);
warning

Configuration take effect on startup. Then, restart the micro-executor