Skip to content

Commit 5f97372

Browse files
committed
use cloudfront to change ical base path
1 parent ab5751a commit 5f97372

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

cloudformation/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@ Resources:
799799
Origins:
800800
- Id: LambdaOrigin
801801
DomainName: !Select [0, !Split ['/', !Select [1, !Split ['https://', !GetAtt AppLambdaUrl.FunctionUrl]]]]
802+
OriginPath: "/api/v1/ical"
802803
CustomOriginConfig:
803804
HTTPPort: 80
804805
HTTPSPort: 443

src/api/index.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,6 @@ async function init(prettyPrint: boolean = false) {
7979
level: process.env.LOG_LEVEL || "info",
8080
transport,
8181
},
82-
rewriteUrl: (req) => {
83-
const url = req.url;
84-
const hostname = req.headers.host || "";
85-
const customDomainBaseMappers: Record<string, string> = {
86-
"ical.acm.illinois.edu": `/api/v1/ical${url}`,
87-
"ical.aws.qa.acmuiuc.org": `/api/v1/ical${url}`,
88-
};
89-
if (hostname in customDomainBaseMappers) {
90-
return customDomainBaseMappers[hostname];
91-
}
92-
return url || "/";
93-
},
9482
disableRequestLogging: true,
9583
genReqId: (request) => {
9684
const header = request.headers["x-apigateway-event"];

0 commit comments

Comments
 (0)