extract config files

This commit is contained in:
sbriat
2023-10-24 11:21:45 +02:00
parent 376260d903
commit f960299565
35 changed files with 313 additions and 113 deletions

View File

@@ -0,0 +1,19 @@
import { registerAs } from '@nestjs/config';
export default registerAs('carpool', () => ({
departureTimeMargin: process.env.DEPARTURE_TIME_MARGIN
? parseInt(process.env.DEPARTURE_TIME_MARGIN, 10)
: 900,
role: process.env.ROLE ?? 'passenger',
seatsProposed: process.env.SEATS_PROPOSED
? parseInt(process.env.SEATS_PROPOSED, 10)
: 3,
seatsRequested: process.env.SEATS_REQUESTED
? parseInt(process.env.SEATS_REQUESTED, 10)
: 1,
strictFrequency: process.env.STRICT_FREQUENCY
? process.env.STRICT_FREQUENCY === 'false'
? false
: true
: false,
}));