Skip to content

Commit

Permalink
refactor: extract CorsOrigins type
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Willenbring committed Jul 28, 2023
1 parent 246c7da commit c006b2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/shared/configuration/src/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApplicationConfiguration } from "./types";
import { ApplicationConfiguration, CorsOrigins } from "./types";
import { RetroAppUrl } from "./RetroAppUrl";

export const configuration = getConfiguration();
Expand Down Expand Up @@ -27,7 +27,7 @@ function getConfiguration(): ApplicationConfiguration {
};
}

function parseCorsOrigins(list?: string): string[] | string | undefined {
function parseCorsOrigins(list?: string): CorsOrigins | undefined {
if (!list) return undefined;

const origins = list.split(",").map((origin) => origin.trim());
Expand Down
4 changes: 3 additions & 1 deletion packages/shared/configuration/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { RetroAppUrl } from "./RetroAppUrl";

export type CorsOrigins = string | string[];

export interface ApplicationConfiguration {
logLevel: string;
backendUrl: RetroAppUrl;
retro: RetroConfiguration;
signalingServerUrl: RetroAppUrl;
corsOrigins: string | string[];
corsOrigins: CorsOrigins;
}

export interface RetroConfiguration {
Expand Down

0 comments on commit c006b2f

Please sign in to comment.