MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / readDatabase

Function readDatabase

apps/api/src/config/env/validate.ts:137–155  ·  view source on GitHub ↗
(source: EnvSource)

Source from the content-addressed store, hash-verified

135});
136
137const readDatabase = (source: EnvSource) => ({
138 DATABASE_URL: nonEmpty(
139 source.DATABASE_URL,
140 source.NODE_ENV === "test" ? "postgresql://test:test@127.0.0.1:1/test" : ""
141 ),
142 DATABASE_POOL_SIZE: toInt(
143 source.DATABASE_POOL_SIZE,
144 10,
145 "DATABASE_POOL_SIZE"
146 ),
147 DATABASE_SSL_REJECT_UNAUTHORIZED:
148 source.DATABASE_SSL_REJECT_UNAUTHORIZED === undefined
149 ? true
150 : toBool(
151 source.DATABASE_SSL_REJECT_UNAUTHORIZED,
152 "DATABASE_SSL_REJECT_UNAUTHORIZED"
153 ),
154 DATABASE_SSL_CA: source.DATABASE_SSL_CA ?? "",
155});
156
157const readAuth = (source: EnvSource) => ({
158 JWT_SECRET: nonEmpty(

Callers 1

readRawFunction · 0.85

Calls 3

nonEmptyFunction · 0.85
toIntFunction · 0.85
toBoolFunction · 0.85

Tested by

no test coverage detected