Skip to content

Commit b9e2220

Browse files
committed
add errorResponse to distribution for spa routing
1 parent e62a0bf commit b9e2220

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/infra/cdk/aws-sdk-js-notes-app-stack.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@ export class AwsSdkJsNotesAppStack extends Stack {
139139
defaultBehavior: {
140140
origin: new origins.S3Origin(websiteBucket),
141141
},
142+
errorResponses: [
143+
{
144+
httpStatus: 403,
145+
responseHttpStatus: 200,
146+
responsePagePath: '/index.html',
147+
},
148+
{
149+
httpStatus: 404,
150+
responseHttpStatus: 200,
151+
responsePagePath: '/index.html',
152+
},
153+
],
142154
});
143155

144156
new CfnOutput(this, "FilesBucket", { value: filesBucket.bucketName });

0 commit comments

Comments
 (0)