@aligent/cdk-prerender-proxy 0.2.5-experimental2 → 0.2.5-experimental5
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.
- package/lib/error-response-construct.js +1 -1
- package/lib/handlers/cache-control.ts +3 -20
- package/lib/handlers/error-response.ts +3 -50
- package/lib/handlers/package-lock.json +1257 -40
- package/lib/handlers/package.json +7 -3
- package/lib/handlers/prerender-check.ts +3 -26
- package/lib/handlers/prerender.ts +3 -42
- package/lib/handlers/tsconfig.json +1 -4
- package/lib/prerender-cf-cache-control-construct.js +1 -1
- package/lib/prerender-check-construct.js +1 -1
- package/lib/prerender-construct.js +1 -1
- package/package.json +6 -4
- package/lib/handlers/node_modules/.package-lock.json +0 -55
- package/lib/handlers/node_modules/@types/aws-lambda/LICENSE +0 -21
- package/lib/handlers/node_modules/@types/aws-lambda/README.md +0 -16
- package/lib/handlers/node_modules/@types/aws-lambda/common/api-gateway.d.ts +0 -79
- package/lib/handlers/node_modules/@types/aws-lambda/common/cloudfront.d.ts +0 -79
- package/lib/handlers/node_modules/@types/aws-lambda/handler.d.ts +0 -171
- package/lib/handlers/node_modules/@types/aws-lambda/index.d.ts +0 -85
- package/lib/handlers/node_modules/@types/aws-lambda/package.json +0 -210
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/alb.d.ts +0 -48
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-authorizer.d.ts +0 -174
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts +0 -187
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/appsync-resolver.d.ts +0 -51
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudformation-custom-resource.d.ts +0 -68
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-request.d.ts +0 -20
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-response.d.ts +0 -21
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-events.d.ts +0 -8
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-logs.d.ts +0 -37
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codebuild-cloudwatch-state.d.ts +0 -104
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-action.d.ts +0 -31
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-pipeline.d.ts +0 -32
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-stage.d.ts +0 -23
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch.d.ts +0 -11
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline.d.ts +0 -55
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/_common.d.ts +0 -41
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/create-auth-challenge.d.ts +0 -22
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-email-sender.d.ts +0 -86
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-message.d.ts +0 -44
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/define-auth-challenge.d.ts +0 -21
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/index.d.ts +0 -119
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-authentication.d.ts +0 -15
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-confirmation.d.ts +0 -22
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-authentication.d.ts +0 -15
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-signup.d.ts +0 -31
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation.d.ts +0 -45
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/user-migration.d.ts +0 -39
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/verify-auth-challenge-response.d.ts +0 -20
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/connect-contact-flow.d.ts +0 -65
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts +0 -45
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/eventbridge.d.ts +0 -18
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/iot.d.ts +0 -28
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-firehose-transformation.d.ts +0 -45
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-stream.d.ts +0 -28
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/lex.d.ts +0 -116
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/msk.d.ts +0 -21
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3-batch.d.ts +0 -41
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3.d.ts +0 -60
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/ses.d.ts +0 -103
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/sns.d.ts +0 -38
- package/lib/handlers/node_modules/@types/aws-lambda/trigger/sqs.d.ts +0 -46
- package/lib/handlers/node_modules/@types/node/LICENSE +0 -21
- package/lib/handlers/node_modules/@types/node/README.md +0 -16
- package/lib/handlers/node_modules/@types/node/assert/strict.d.ts +0 -4
- package/lib/handlers/node_modules/@types/node/assert.d.ts +0 -124
- package/lib/handlers/node_modules/@types/node/async_hooks.d.ts +0 -226
- package/lib/handlers/node_modules/@types/node/base.d.ts +0 -19
- package/lib/handlers/node_modules/@types/node/buffer.d.ts +0 -84
- package/lib/handlers/node_modules/@types/node/child_process.d.ts +0 -526
- package/lib/handlers/node_modules/@types/node/cluster.d.ts +0 -262
- package/lib/handlers/node_modules/@types/node/console.d.ts +0 -133
- package/lib/handlers/node_modules/@types/node/constants.d.ts +0 -13
- package/lib/handlers/node_modules/@types/node/crypto.d.ts +0 -1580
- package/lib/handlers/node_modules/@types/node/dgram.d.ts +0 -141
- package/lib/handlers/node_modules/@types/node/diagnostic_channel.d.ts +0 -34
- package/lib/handlers/node_modules/@types/node/dns/promises.d.ts +0 -97
- package/lib/handlers/node_modules/@types/node/dns.d.ts +0 -322
- package/lib/handlers/node_modules/@types/node/domain.d.ts +0 -24
- package/lib/handlers/node_modules/@types/node/events.d.ts +0 -93
- package/lib/handlers/node_modules/@types/node/fs/promises.d.ts +0 -592
- package/lib/handlers/node_modules/@types/node/fs.d.ts +0 -2239
- package/lib/handlers/node_modules/@types/node/globals.d.ts +0 -655
- package/lib/handlers/node_modules/@types/node/globals.global.d.ts +0 -1
- package/lib/handlers/node_modules/@types/node/http.d.ts +0 -434
- package/lib/handlers/node_modules/@types/node/http2.d.ts +0 -976
- package/lib/handlers/node_modules/@types/node/https.d.ts +0 -36
- package/lib/handlers/node_modules/@types/node/index.d.ts +0 -58
- package/lib/handlers/node_modules/@types/node/inspector.d.ts +0 -3041
- package/lib/handlers/node_modules/@types/node/module.d.ts +0 -52
- package/lib/handlers/node_modules/@types/node/net.d.ts +0 -326
- package/lib/handlers/node_modules/@types/node/os.d.ts +0 -239
- package/lib/handlers/node_modules/@types/node/package.json +0 -232
- package/lib/handlers/node_modules/@types/node/path.d.ts +0 -163
- package/lib/handlers/node_modules/@types/node/perf_hooks.d.ts +0 -310
- package/lib/handlers/node_modules/@types/node/process.d.ts +0 -461
- package/lib/handlers/node_modules/@types/node/punycode.d.ts +0 -75
- package/lib/handlers/node_modules/@types/node/querystring.d.ts +0 -28
- package/lib/handlers/node_modules/@types/node/readline.d.ts +0 -192
- package/lib/handlers/node_modules/@types/node/repl.d.ts +0 -395
- package/lib/handlers/node_modules/@types/node/stream/promises.d.ts +0 -67
- package/lib/handlers/node_modules/@types/node/stream.d.ts +0 -471
- package/lib/handlers/node_modules/@types/node/string_decoder.d.ts +0 -7
- package/lib/handlers/node_modules/@types/node/timers/promises.d.ts +0 -21
- package/lib/handlers/node_modules/@types/node/timers.d.ts +0 -27
- package/lib/handlers/node_modules/@types/node/tls.d.ts +0 -793
- package/lib/handlers/node_modules/@types/node/trace_events.d.ts +0 -61
- package/lib/handlers/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
- package/lib/handlers/node_modules/@types/node/ts3.6/base.d.ts +0 -68
- package/lib/handlers/node_modules/@types/node/ts3.6/index.d.ts +0 -7
- package/lib/handlers/node_modules/@types/node/tty.d.ts +0 -66
- package/lib/handlers/node_modules/@types/node/url.d.ts +0 -116
- package/lib/handlers/node_modules/@types/node/util/types.d.ts +0 -53
- package/lib/handlers/node_modules/@types/node/util.d.ts +0 -156
- package/lib/handlers/node_modules/@types/node/v8.d.ts +0 -198
- package/lib/handlers/node_modules/@types/node/vm.d.ts +0 -152
- package/lib/handlers/node_modules/@types/node/wasi.d.ts +0 -86
- package/lib/handlers/node_modules/@types/node/worker_threads.d.ts +0 -282
- package/lib/handlers/node_modules/@types/node/zlib.d.ts +0 -361
- package/lib/handlers/node_modules/axios/CHANGELOG.md +0 -685
- package/lib/handlers/node_modules/axios/LICENSE +0 -19
- package/lib/handlers/node_modules/axios/README.md +0 -800
- package/lib/handlers/node_modules/axios/UPGRADE_GUIDE.md +0 -162
- package/lib/handlers/node_modules/axios/dist/axios.js +0 -1756
- package/lib/handlers/node_modules/axios/dist/axios.map +0 -1
- package/lib/handlers/node_modules/axios/dist/axios.min.js +0 -3
- package/lib/handlers/node_modules/axios/dist/axios.min.map +0 -1
- package/lib/handlers/node_modules/axios/index.d.ts +0 -161
- package/lib/handlers/node_modules/axios/index.js +0 -1
- package/lib/handlers/node_modules/axios/lib/adapters/README.md +0 -37
- package/lib/handlers/node_modules/axios/lib/adapters/http.js +0 -303
- package/lib/handlers/node_modules/axios/lib/adapters/xhr.js +0 -179
- package/lib/handlers/node_modules/axios/lib/axios.js +0 -56
- package/lib/handlers/node_modules/axios/lib/cancel/Cancel.js +0 -19
- package/lib/handlers/node_modules/axios/lib/cancel/CancelToken.js +0 -57
- package/lib/handlers/node_modules/axios/lib/cancel/isCancel.js +0 -5
- package/lib/handlers/node_modules/axios/lib/core/Axios.js +0 -95
- package/lib/handlers/node_modules/axios/lib/core/InterceptorManager.js +0 -52
- package/lib/handlers/node_modules/axios/lib/core/README.md +0 -7
- package/lib/handlers/node_modules/axios/lib/core/buildFullPath.js +0 -20
- package/lib/handlers/node_modules/axios/lib/core/createError.js +0 -18
- package/lib/handlers/node_modules/axios/lib/core/dispatchRequest.js +0 -79
- package/lib/handlers/node_modules/axios/lib/core/enhanceError.js +0 -42
- package/lib/handlers/node_modules/axios/lib/core/mergeConfig.js +0 -87
- package/lib/handlers/node_modules/axios/lib/core/settle.js +0 -25
- package/lib/handlers/node_modules/axios/lib/core/transformData.js +0 -20
- package/lib/handlers/node_modules/axios/lib/defaults.js +0 -98
- package/lib/handlers/node_modules/axios/lib/helpers/README.md +0 -7
- package/lib/handlers/node_modules/axios/lib/helpers/bind.js +0 -11
- package/lib/handlers/node_modules/axios/lib/helpers/buildURL.js +0 -70
- package/lib/handlers/node_modules/axios/lib/helpers/combineURLs.js +0 -14
- package/lib/handlers/node_modules/axios/lib/helpers/cookies.js +0 -53
- package/lib/handlers/node_modules/axios/lib/helpers/deprecatedMethod.js +0 -24
- package/lib/handlers/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -14
- package/lib/handlers/node_modules/axios/lib/helpers/isAxiosError.js +0 -11
- package/lib/handlers/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -68
- package/lib/handlers/node_modules/axios/lib/helpers/normalizeHeaderName.js +0 -12
- package/lib/handlers/node_modules/axios/lib/helpers/parseHeaders.js +0 -53
- package/lib/handlers/node_modules/axios/lib/helpers/spread.js +0 -27
- package/lib/handlers/node_modules/axios/lib/utils.js +0 -351
- package/lib/handlers/node_modules/axios/package.json +0 -86
- package/lib/handlers/node_modules/buffer-from/LICENSE +0 -21
- package/lib/handlers/node_modules/buffer-from/index.js +0 -69
- package/lib/handlers/node_modules/buffer-from/package.json +0 -19
- package/lib/handlers/node_modules/buffer-from/readme.md +0 -69
- package/lib/handlers/node_modules/follow-redirects/LICENSE +0 -18
- package/lib/handlers/node_modules/follow-redirects/README.md +0 -148
- package/lib/handlers/node_modules/follow-redirects/debug.js +0 -14
- package/lib/handlers/node_modules/follow-redirects/http.js +0 -1
- package/lib/handlers/node_modules/follow-redirects/https.js +0 -1
- package/lib/handlers/node_modules/follow-redirects/index.js +0 -531
- package/lib/handlers/node_modules/follow-redirects/package.json +0 -59
- package/lib/handlers/node_modules/source-map/CHANGELOG.md +0 -301
- package/lib/handlers/node_modules/source-map/LICENSE +0 -28
- package/lib/handlers/node_modules/source-map/README.md +0 -742
- package/lib/handlers/node_modules/source-map/dist/source-map.debug.js +0 -3234
- package/lib/handlers/node_modules/source-map/dist/source-map.js +0 -3233
- package/lib/handlers/node_modules/source-map/dist/source-map.min.js +0 -2
- package/lib/handlers/node_modules/source-map/dist/source-map.min.js.map +0 -1
- package/lib/handlers/node_modules/source-map/lib/array-set.js +0 -121
- package/lib/handlers/node_modules/source-map/lib/base64-vlq.js +0 -140
- package/lib/handlers/node_modules/source-map/lib/base64.js +0 -67
- package/lib/handlers/node_modules/source-map/lib/binary-search.js +0 -111
- package/lib/handlers/node_modules/source-map/lib/mapping-list.js +0 -79
- package/lib/handlers/node_modules/source-map/lib/quick-sort.js +0 -114
- package/lib/handlers/node_modules/source-map/lib/source-map-consumer.js +0 -1145
- package/lib/handlers/node_modules/source-map/lib/source-map-generator.js +0 -425
- package/lib/handlers/node_modules/source-map/lib/source-node.js +0 -413
- package/lib/handlers/node_modules/source-map/lib/util.js +0 -488
- package/lib/handlers/node_modules/source-map/package.json +0 -73
- package/lib/handlers/node_modules/source-map/source-map.d.ts +0 -98
- package/lib/handlers/node_modules/source-map/source-map.js +0 -8
- package/lib/handlers/node_modules/source-map-support/LICENSE.md +0 -21
- package/lib/handlers/node_modules/source-map-support/README.md +0 -284
- package/lib/handlers/node_modules/source-map-support/browser-source-map-support.js +0 -114
- package/lib/handlers/node_modules/source-map-support/package.json +0 -31
- package/lib/handlers/node_modules/source-map-support/register.js +0 -1
- package/lib/handlers/node_modules/source-map-support/source-map-support.js +0 -604
|
@@ -29,4 +29,4 @@ class ErrorResponseFunction extends core_1.Construct {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
exports.ErrorResponseFunction = ErrorResponseFunction;
|
|
32
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItcmVzcG9uc2UtY29uc3RydWN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZXJyb3ItcmVzcG9uc2UtY29uc3RydWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHdDQUEwQztBQUMxQyxzRUFBbUU7QUFDbkUsb0RBQThDO0FBQzlDLDREQUF1RDtBQU92RCxNQUFhLHFCQUFzQixTQUFRLGdCQUFTO0lBR2hELFlBQVksS0FBZ0IsRUFBRSxFQUFVLEVBQUUsT0FBcUM7O1FBQzNFLEtBQUssQ0FBQyxLQUFLLEVBQUUsRUFBRSxDQUFDLENBQUM7UUFFakIsSUFBSSxDQUFDLFlBQVksR0FBRyxJQUFJLDZCQUFZLENBQUMsWUFBWSxDQUM3QyxJQUFJLEVBQ0osdUJBQXVCLEVBQ3ZCO1lBQ0ksSUFBSSxFQUFFLG1CQUFRLENBQUMsTUFBTSxDQUFDO2dCQUNsQixLQUFLLEVBQUUsR0FBRyxTQUFTLDZCQUE2QjtnQkFDaEQsT0FBTyxFQUFFLG9CQUFPLENBQUMsV0FBVztnQkFDNUIsU0FBUyxFQUFFLElBQUk7Z0JBQ2YsV0FBVyxFQUFFLEdBQUcsU0FBUyxZQUFZO2d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ICAgICAgICAgLy8gb2Ygbm8gZW52aXJvbm1lbnQgdmFyaWFibGVzIGF0IHJ1bnRpbWUuXG4gICAgICAgICAgICAgICAgICAgIGRlZmluZToge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2Nlc3MuZW52LlBBVEhfUFJFRklYJzogSlNPTi5zdHJpbmdpZnkob3B0aW9ucy5wYXRoUHJlZml4ID8/ICcnKSxcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gYXMgYW55KSxcbiAgICAgICAgICAgICAgICBydW50aW1lOiBSdW50aW1lLk5PREVKU18xNF9YLFxuICAgICAgICAgICAgICAgIGhhbmRsZXI6ICdpbmRleC5oYW5kbGVyJyxcbiAgICAgICAgICAgIH1cbiAgICAgICAgKTtcbiAgICB9XG59Il19
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
/*
|
|
4
|
-
Prerender cache control function
|
|
5
|
-
Consider associate this function as *origin response* function
|
|
6
|
-
*/
|
|
7
|
-
export const handler = async (event: CloudFrontResponseEvent): Promise<CloudFrontResponse> => {
|
|
8
|
-
const cacheKey = process.env.PRERENDER_CACHE_KEY || 'x-prerender-requestid';
|
|
9
|
-
const cacheMaxAge = process.env.PRERENDER_CACHE_MAX_AGE || '0';
|
|
10
|
-
let response = event.Records[0].cf.response;
|
|
1
|
+
import middy from "@middy/core";
|
|
2
|
+
import { PrerenderCacheControlHandler} from "@aligent/cdk-lambda-at-edge-handlers";
|
|
11
3
|
|
|
12
|
-
|
|
13
|
-
response.headers['Cache-Control'] = [
|
|
14
|
-
{
|
|
15
|
-
key: 'Cache-Control',
|
|
16
|
-
value: `max-age=${cacheMaxAge}`
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
return response;
|
|
21
|
-
}
|
|
4
|
+
export const handler = middy(PrerenderCacheControlHandler);
|
|
@@ -1,51 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import axios from "axios";
|
|
4
|
-
import { URL } from 'url';
|
|
5
|
-
import * as https from 'https';
|
|
1
|
+
import middy from "@middy/core";
|
|
2
|
+
import { PrerenderErrorResponseHandler } from "@aligent/cdk-lambda-at-edge-handlers";
|
|
6
3
|
|
|
7
|
-
const
|
|
8
|
-
const PATH_PREFIX = process.env.PATH_PREFIX;
|
|
9
|
-
|
|
10
|
-
// Create axios client outside of lambda function for re-use between calls
|
|
11
|
-
const instance = axios.create({
|
|
12
|
-
timeout: 1000,
|
|
13
|
-
// Don't follow redirects
|
|
14
|
-
maxRedirects: 0,
|
|
15
|
-
// Only valid response codes are 200
|
|
16
|
-
validateStatus: function (status) {
|
|
17
|
-
return status == 200;
|
|
18
|
-
},
|
|
19
|
-
// keep connection alive so we don't constantly do SSL negotiation
|
|
20
|
-
httpsAgent: new https.Agent({ keepAlive: true }),
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export const handler = (event: CloudFrontResponseEvent): Promise<CloudFrontResponse|CloudFrontRequest> => {
|
|
24
|
-
let response = event.Records[0].cf.response;
|
|
25
|
-
let request = event.Records[0].cf.request;
|
|
26
|
-
|
|
27
|
-
if (response.status != '200' &&
|
|
28
|
-
! request.headers['x-request-prerender'] &&
|
|
29
|
-
request.uri != `${PATH_PREFIX}/index.html`) {
|
|
30
|
-
|
|
31
|
-
// Fetch default page and return body
|
|
32
|
-
return instance.get(`https://${FRONTEND_HOST}${PATH_PREFIX}/index.html`).then((res) => {
|
|
33
|
-
response.body = res.data;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
response.headers['content-type'] = [{
|
|
37
|
-
key: 'Content-Type',
|
|
38
|
-
value: 'text/html'
|
|
39
|
-
}];
|
|
40
|
-
|
|
41
|
-
// Remove content-length if set as this may be the value from the origin.
|
|
42
|
-
delete response.headers['content-length']
|
|
43
|
-
|
|
44
|
-
return response;
|
|
45
|
-
}).catch((err) => {
|
|
46
|
-
return response
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return Promise.resolve(response);
|
|
51
|
-
}
|
|
4
|
+
export const handler = middy(PrerenderErrorResponseHandler);
|