fix: postgres and redis url validation (#548)
This commit is contained in:
parent
532001fd82
commit
4a2a5a7a4d
1 changed files with 10 additions and 2 deletions
|
|
@ -11,14 +11,22 @@ import { plainToInstance } from 'class-transformer';
|
||||||
export class EnvironmentVariables {
|
export class EnvironmentVariables {
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsUrl(
|
@IsUrl(
|
||||||
{ protocols: ['postgres', 'postgresql'], require_tld: false },
|
{
|
||||||
|
protocols: ['postgres', 'postgresql'],
|
||||||
|
require_tld: false,
|
||||||
|
allow_underscores: true,
|
||||||
|
},
|
||||||
{ message: 'DATABASE_URL must be a valid postgres connection string' },
|
{ message: 'DATABASE_URL must be a valid postgres connection string' },
|
||||||
)
|
)
|
||||||
DATABASE_URL: string;
|
DATABASE_URL: string;
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsUrl(
|
@IsUrl(
|
||||||
{ protocols: ['redis', 'rediss'], require_tld: false },
|
{
|
||||||
|
protocols: ['redis', 'rediss'],
|
||||||
|
require_tld: false,
|
||||||
|
allow_underscores: true,
|
||||||
|
},
|
||||||
{ message: 'REDIS_URL must be a valid redis connection string' },
|
{ message: 'REDIS_URL must be a valid redis connection string' },
|
||||||
)
|
)
|
||||||
REDIS_URL: string;
|
REDIS_URL: string;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue