@jaypie/constructs 1.2.25 → 1.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1168,6 +1168,10 @@ class JaypieApiGateway extends constructs.Construct {
|
|
|
1168
1168
|
process.env.CDK_ENV_API_HOSTED_ZONE) {
|
|
1169
1169
|
host = mergeDomain(process.env.CDK_ENV_API_SUBDOMAIN, process.env.CDK_ENV_API_HOSTED_ZONE);
|
|
1170
1170
|
}
|
|
1171
|
+
// Set PROJECT_BASE_URL on the Lambda if host is resolved and handler supports it
|
|
1172
|
+
if (host && "addEnvironment" in handler) {
|
|
1173
|
+
handler.addEnvironment("PROJECT_BASE_URL", `https://${host}`);
|
|
1174
|
+
}
|
|
1171
1175
|
const apiGatewayName = name || constructEnvName("ApiGateway");
|
|
1172
1176
|
const apiDomainName = constructEnvName("ApiDomainName");
|
|
1173
1177
|
let hostedZone;
|
|
@@ -2437,6 +2441,10 @@ class JaypieDistribution extends constructs.Construct {
|
|
|
2437
2441
|
else if (this.isIOrigin(handler)) {
|
|
2438
2442
|
origin = handler;
|
|
2439
2443
|
}
|
|
2444
|
+
// Set PROJECT_BASE_URL on the Lambda if host is resolved and handler supports it
|
|
2445
|
+
if (host && this.isIFunction(handler) && "addEnvironment" in handler) {
|
|
2446
|
+
handler.addEnvironment("PROJECT_BASE_URL", `https://${host}`);
|
|
2447
|
+
}
|
|
2440
2448
|
}
|
|
2441
2449
|
// Build default behavior
|
|
2442
2450
|
let defaultBehavior;
|