Skip to content

Commit

Permalink
feat: option to disable caddy config for ui/api
Browse files Browse the repository at this point in the history
  • Loading branch information
gempain committed Dec 8, 2020
1 parent 5dae672 commit 3629cbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/caddy/generate-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ export async function generateConfig(): Promise<any> {
sites: {
listen: sslDisabled ? [':80'] : [':443'],
routes: [
apiRoute,
uiRoute,
...(env.MELI_STANDALONE ? [] : [
apiRoute,
uiRoute,
]),
...sites.flatMap(generateSiteRoutes),
fallback,
],
Expand Down
5 changes: 5 additions & 0 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface Env {
MELI_UI_URL: string;
MELI_UI_URL_INTERNAL: string;
MELI_SITES_URL: string;
MELI_STANDALONE: boolean;
MELI_UI_DIR: string;
MELI_JWT_SECRET: string;
MELI_JWT_TOKEN_EXPIRATION: number;
Expand Down Expand Up @@ -98,6 +99,10 @@ const envSpec: EnvSpec<Env> = {
MELI_SITES_URL: {
schema: string().optional().custom(isUrl).default(process.env.MELI_URL || null),
},
MELI_STANDALONE: {
transform: stringToBoolean(),
schema: boolean().optional().default(false),
},
MELI_UI_DIR: {
schema: string().optional(),
},
Expand Down

0 comments on commit 3629cbb

Please sign in to comment.