mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-04 08:49:59 -04:00
fix: rename parseOptionalInt to parseOptionalNumber
This allows us to handle the possible errors due to non-integer numbers with joi and return more precise error messages. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
151e12a8a7
commit
45df0e6edb
7 changed files with 27 additions and 22 deletions
|
@ -7,7 +7,7 @@ import { registerAs } from '@nestjs/config';
|
|||
import * as Joi from 'joi';
|
||||
|
||||
import { Loglevel } from './loglevel.enum';
|
||||
import { buildErrorMessage, parseOptionalInt } from './utils';
|
||||
import { buildErrorMessage, parseOptionalNumber } from './utils';
|
||||
|
||||
export interface AppConfig {
|
||||
domain: string;
|
||||
|
@ -48,7 +48,7 @@ export default registerAs('appConfig', () => {
|
|||
{
|
||||
domain: process.env.HD_DOMAIN,
|
||||
rendererOrigin: process.env.HD_RENDERER_ORIGIN,
|
||||
port: parseOptionalInt(process.env.PORT),
|
||||
port: parseOptionalNumber(process.env.PORT),
|
||||
loglevel: process.env.HD_LOGLEVEL,
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue