Skip to content

Commit

Permalink
Add CloudFront to API
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchernchong committed May 17, 2024
1 parent 76262fe commit 34f8022
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions sst.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const DOMAIN = {
development: "dev.api.sgmotortrends.com",
staging: "staging.api.sgmotortrends.com",
production: "api.sgmotortrends.com",
} as const;

Expand All @@ -19,9 +20,9 @@ export default $config({
};
},
async run() {
const hono = new sst.aws.Function("Hono", {
const hono = new sst.aws.Function("Api", {
architecture: "arm64",
description: "Hono API for LTA Datasets",
description: "Hono API for LTA Cars Datasets",
environment: {
MONGODB_URI: process.env.MONGODB_URI,
},
Expand All @@ -33,6 +34,13 @@ export default $config({
},
});

new sst.aws.Router("LTACarsDataset", {
domain: DOMAIN[$app.stage],
routes: {
"/*": hono.url,
},
});

return {
api: hono.url,
};
Expand Down

0 comments on commit 34f8022

Please sign in to comment.