use configuration package as middleware

This commit is contained in:
sbriat
2023-10-25 16:03:17 +02:00
parent efb35d6d2b
commit 5094e27ad1
28 changed files with 558 additions and 747 deletions

View File

@@ -1,5 +1,13 @@
import { registerAs } from '@nestjs/config';
export interface CarpoolConfig {
departureTimeMargin: number;
role: string;
seatsProposed: number;
seatsRequested: number;
strictFrequency: boolean;
}
export default registerAs('carpool', () => ({
departureTimeMargin: process.env.DEPARTURE_TIME_MARGIN
? parseInt(process.env.DEPARTURE_TIME_MARGIN, 10)

View File

@@ -1,5 +1,9 @@
import { registerAs } from '@nestjs/config';
export interface PaginationConfig {
perPage: number;
}
export default registerAs('pagination', () => ({
perPage: process.env.PER_PAGE ? parseInt(process.env.PER_PAGE, 10) : 10,
}));