Skip to content

Commit

Permalink
fix: add a site id to razzle api path
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Jul 27, 2024
1 parent f25ea84 commit 022049b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/plone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface PloneBaseOptions {
}
export interface PloneOptions {
readonly version?: string;
readonly site_id?: string;
readonly backend?: PloneBaseOptions;
readonly frontend?: PloneBaseOptions;
readonly imagePullSecrets?: string[];
Expand All @@ -30,6 +31,10 @@ export class Plone extends Construct {
constructor(scope: Construct, id: string, options: PloneOptions = {}) {
super(scope, id);

// ------------------------------------------------------------------------
// General
const site_id = options.site_id ?? 'Plone';

// ------------------------------------------------------------------------
// Backend
const backend = options.backend ?? {};
Expand Down Expand Up @@ -134,7 +139,7 @@ export class Plone extends Construct {
var frontendEnvironment = frontend.environment ?? new kplus.Env([], {});
if (frontendEnvironment.variables.RAZZLE_INTERNAL_API_PATH === undefined) {
// connect with backend service
frontendEnvironment?.addVariable('RAZZLE_INTERNAL_API_PATH', kplus.EnvValue.fromValue(`http://${backendService.name}:${backendPort}`));
frontendEnvironment?.addVariable('RAZZLE_INTERNAL_API_PATH', kplus.EnvValue.fromValue(`http://${backendService.name}:${backendPort}/${site_id}`));
}

// Deployment
Expand Down

0 comments on commit 022049b

Please sign in to comment.