Liking cljdoc? Tell your friends :D

com.fulcrologic.fulcro.server.config

Utilities for managing server configuration via EDN files. These functions expect a config/defaults.edn to exist on the classpath as a definition for server configuration default values. When you call load-config it will deep merge the file you supply with the base defaults to return the 'complete' configuration. When loading configurations a relative path is evaluated against CLASSPATH and an absolute path against the real filesystem.

The values in the EDN files can be :env/VAR to pull a string from an env variable, and :env.edn/VAR to do a read-string against the value of an environment variable.

Utilities for managing server configuration via EDN files.  These functions expect a config/defaults.edn to exist
on the classpath as a definition for server configuration default values.  When you call `load-config` it will
deep merge the file you supply with the base defaults to return the 'complete' configuration.  When loading
configurations a relative path is evaluated against CLASSPATH and an absolute path against the real filesystem.

The values in the EDN files can be :env/VAR to pull a string from an env variable, and :env.edn/VAR to do a `read-string`
against the value of an environment variable.
raw docstring

get-system-propclj

(get-system-prop prop-name)
source

load-configclj

(load-config)
(load-config {:keys [config-path]})

Load a configuration file via the given options.

options is a map with keys:

  • :config-path : The path to the file to load (in addition to the addl behavior described below).

Reads (from classpath) config/defaults.edn, then deep merges the EDN content of the config file you specify into that and evaluates environment variable expansions.

You may use a Java system property to specify (override) the config file used:

java -Dconfig=/usr/local/etc/app.edn ...

If no such property is used then config-path MUST be supplied (or this will throw an exception).

Values in the EDN of the form :env/VAR mean to use the raw string value of an environment variable, and :env.edn/VAR mean to use the read-string value of the environment variable as that value.

So the classpath resource config/defaults.edn might contain:

{:port 3000
 :service :A}

and /usr/local/etc/app.edn might contain:

{:port :env.edn/PORT}

and a call to (load-config "/usr/local/etc/app.edn") on a system with env variable PORT="8080" would return:

{:port 8080  ;; as an integer, not a string
 :service :A}

If your EDN file includes a symbol (which must be namespaced) then it will try to require and resolve it dynamically as the configuration loads.

Load a configuration file via the given options.

options is a map with keys:

- :config-path : The path to the file to load (in addition to the addl behavior described below).

Reads (from classpath) `config/defaults.edn`, then deep merges the EDN content
of the config file you specify into that and evaluates environment variable expansions.

You may use a Java system property to specify (override) the config file used:

```
java -Dconfig=/usr/local/etc/app.edn ...
```

If no such property is used then config-path MUST be supplied (or this will throw an exception).

Values in the EDN of the form :env/VAR mean to use the raw string value of an environment variable, and
:env.edn/VAR mean to use the `read-string` value of the environment variable as that value.

So the classpath resource config/defaults.edn might contain:

```
{:port 3000
 :service :A}
```

and `/usr/local/etc/app.edn` might contain:

```
{:port :env.edn/PORT}
```

and a call to `(load-config "/usr/local/etc/app.edn")` on a system with env variable `PORT="8080"` would return:

```
{:port 8080  ;; as an integer, not a string
 :service :A}
```

If your EDN file includes a symbol (which must be namespaced) then it will try to require and resolve
it dynamically as the configuration loads.
sourceraw docstring

load-ednclj

(load-edn file-path)

If given a relative path, looks on classpath (via class loader) for the file, reads the content as EDN, and returns it. If the path is an absolute path, it reads it as EDN and returns that. If the resource is not found, returns nil.

This function returns the EDN file without further interpretation (no merging or env evaluation). Normally you want to use load-config instead.

If given a relative path, looks on classpath (via class loader) for the file, reads the content as EDN, and returns it.
If the path is an absolute path, it reads it as EDN and returns that.
If the resource is not found, returns nil.

This function returns the EDN file without further interpretation (no merging or env evaluation).  Normally you want
to use `load-config` instead.
sourceraw docstring

open-config-fileclj

(open-config-file file-path)

Calls load-edn on file-path, and throws an ex-info if that failed.

Calls load-edn on `file-path`,
and throws an ex-info if that failed.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close