0.8.0 • Published 2 years ago

@scholten.dev/api-base v0.8.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Api base

services/configuration

Configuration service will try to map environment variables to an existing configuration class.

If the environment variable doesn't exist, the already existing value in the baseConfig will be used.

If the type is not matching, an error will be thrown.

Note: environment variables must be prefixed with CONFIG_. Example: CONFIG_credentials_password=myPassword

import {Configuration} from @scholten.dev/api-base

interface IConfig {
    devMode: boolean;
    credentials: {
        username: string;
        password: string;
    }
}

const baseConfig: IConfig = {
    devMode: true,
    credentials: {
        username: "user"
        password: "pass"
    }
}

const config = Configuration<IConfig>(baseConfig);

Health check

get /api/healthz

0.8.0

2 years ago

0.5.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.4.1

2 years ago

0.3.2

2 years ago

0.4.0

2 years ago

0.4.2

2 years ago

0.3.1

2 years ago

0.3.0

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago