Skip to content

Commit

Permalink
fix(serverless-cms-aws): add WEBINY_ADMIN_ENV and WEBINY_WEBSITE_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel910 committed Jun 7, 2024
1 parent 91554b6 commit f365509
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ declare namespace NodeJS {
MOCK_DYNAMODB_ENDPOINT?: string;
ELASTICSEARCH_PORT?: string;
WEBINY_ENV?: string;
WEBINY_ADMIN_ENV?: string;
WEBINY_WEBSITE_ENV?: string;
REACT_APP_DEBUG?: "true" | "false" | string;
AWS_REGION?: string;
REACT_APP_WEBINY_VERSION?: string;
Expand Down
8 changes: 6 additions & 2 deletions packages/serverless-cms-aws/src/createAdminAppConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ import { ApiOutput } from "@webiny/pulumi-aws";

export const createAdminAppConfig = (modifier?: ReactAppConfigModifier) => {
return createReactAppConfig(baseParams => {
const { config } = baseParams;
const { config, options } = baseParams;

config.customEnv(env => ({ ...env, PORT: 3001 }));
config.customEnv(env => ({
...env,
PORT: process.env.PORT || 3001,
WEBINY_ADMIN_ENV: options.env
}));

config.pulumiOutputToEnv<ApiOutput>("apps/api", ({ output, env }) => {
return {
Expand Down
8 changes: 6 additions & 2 deletions packages/serverless-cms-aws/src/createWebsiteAppConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ import { ApiOutput } from "@webiny/pulumi-aws";

export const createWebsiteAppConfig = (modifier?: ReactAppConfigModifier) => {
return createReactAppConfig(baseParams => {
const { config } = baseParams;
const { config, options } = baseParams;

config.customEnv(env => ({ ...env, PORT: 3000 }));
config.customEnv(env => ({
...env,
PORT: process.env.PORT || 3000,
WEBINY_WEBSITE_ENV: options.env
}));

config.pulumiOutputToEnv<ApiOutput>("apps/api", ({ output, env }) => {
return {
Expand Down
2 changes: 2 additions & 0 deletions typings/env/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ declare namespace NodeJS {
MOCK_DYNAMODB_ENDPOINT?: string;
ELASTICSEARCH_PORT?: string;
WEBINY_ENV?: string;
WEBINY_ADMIN_ENV?: string;
WEBINY_WEBSITE_ENV?: string;
REACT_APP_DEBUG?: "true" | "false" | string;
AWS_REGION?: string;
REACT_APP_WEBINY_VERSION?: string;
Expand Down

0 comments on commit f365509

Please sign in to comment.