Skip to content

Commit

Permalink
fix: add a site id to razzle api path (#8)
Browse files Browse the repository at this point in the history
* fix: add a site id to razzle api path

* fix test output

* fix package.json

* camelCase Du olles Kamel

* chore: self mutation

Signed-off-by: github-actions <[email protected]>

---------

Signed-off-by: github-actions <[email protected]>
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
jensens and github-actions authored Jul 27, 2024
1 parent e09f00e commit f9eee9b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
11 changes: 11 additions & 0 deletions API.md

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 siteId?: 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 siteId = options.siteId ?? '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}/${siteId}`));
}

// Deployment
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/plone.test.ts.snap

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

0 comments on commit f9eee9b

Please sign in to comment.