You can load configuration file in YAML format like that:
foo: "bar"
server:
host: "example.com"
port: 8080
import solfege from "solfegejs";
import MyBundle from "./MyBundle";
// Create application
let application = solfege.factory();
application.addBundle(new MyBundle);
// Load configuration
application.loadConfigurationFile(`${__dirname}/config/production.yml`, "yaml");
Now the properties are available in the service container:
services:
my_service:
class: "MyClass"
arguments:
- "%foo%"
- "%server.host%"
- "%server.port%"
You can override configuration file with another one (see https://github.com/neolao/config-yaml):
default.yml
:
foo: "hello"
server:
host: "example.com"
port: 80
production.yml
:
imports:
- { resource: "default.yml" }
foo: "bar"
server:
host: "example.com"
port: 8080
Name | Description |
---|---|
main_directory_path |
Directory of the main NodeJS file |
configuration_directory_path |
Directory of the configuration file (if provided) |