Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConfigService

Parses process.env to create a clean configuration interface

Hierarchy

  • ConfigService

Index

Constructors

constructor

Properties

buildVersion

buildVersion: string

Track the current version of the app running in the container.

Private env

env: object

Type declaration

  • [key: string]: string

Accessors

academicYear

  • get academicYear(): number
  • Determine the current academic year based on server time

    If the date is between Jan 1st and Jun 30th (inclusive), then the academic year is the current calendar year. If the date is between Jul 1st and Dec 31st (inclusive), then the academic year is the next calendar year.

    Returns number

authMode

casBaseURL

  • get casBaseURL(): string
  • Return the base URL for HarvardKey's cas authentication process Should strip out any auth credentials, query strings and hashes, and remove any trailing slash

    Returns string

casServiceURL

  • get casServiceURL(): string
  • Return the /validate endpoint for the application, which will be sent to HarvardKey as the service URL. Should strip out any auth credentials, query strings and hashes, and remove any trailing slash

    Returns string

Private casURL

  • get casURL(): URL
  • Return a WHATWG URL object for the CAS URL, thowing an error if CAS_URL is not specified

    As URL objects are mutable, we should avoid exposing and/or modifying this value directly

    Returns URL

clientBaseURL

  • get clientBaseURL(): string
  • Return the base URL for the client application. Used as default return redirect in the auth process. Should strip out any auth credentials, query strings and hashes, and remove any trailing slash

    Returns string

Private clientURL

  • get clientURL(): URL
  • Return a WHATWG URL object for the CLIENT URL, thowing an error if CLIENT_URL is not specified

    As URL objects are mutable, we should avoid exposing and/or modifying this value directly

    Returns URL

dbOptions

  • get dbOptions(): PostgresConnectionOptions
  • Return connection parameters for the TypeORM module

    The entities property uses a file glob to final all declared entities. Because we're transpiling our code and copying into docker for production, we need to slightly modify the path and extension for our entities.

    Returns PostgresConnectionOptions

isDevelopment

  • get isDevelopment(): boolean

isProduction

  • get isProduction(): boolean

logLevel

  • get logLevel(): string
  • Ensures that the log level in the environment variable is a valid value. If it's not, or if it's undefined, then return error as our default.

    Returns string

redisClientOptions

  • get redisClientOptions(): ClientOpts

Private serverURL

  • get serverURL(): URL
  • Return a WHATWG URL object for the SERVER URL, thowing an error if SERVER_URL is not specified

    As URL objects are mutable, we should avoid exposing and/or modifying this value directly

    Returns URL

Methods

get

  • get(key: string): string

getSessionSettings

  • getSessionSettings(store: RedisStore): NestSessionOptions

Private readContainerVersion

  • readContainerVersion(): string

Generated using TypeDoc