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,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,
}));