Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
examples: update playground
Browse files Browse the repository at this point in the history
  • Loading branch information
fwang committed Oct 16, 2024
1 parent 7f5ac29 commit 6ea6828
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/internal/playground/functions/apiv1/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const handler = async (event) => {
return {
statusCode: 200,
body: JSON.stringify({ event }, null, 2),
};
};
11 changes: 11 additions & 0 deletions examples/internal/playground/sst.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default $config({

const vpc = addVpc();
const bucket = addBucket();
//const apiv1 = addApiV1();
//const apiv2 = addApiV2();
//const app = addFunction();
//const service = addService();
Expand Down Expand Up @@ -43,6 +44,16 @@ export default $config({
return cron;
}

function addApiV1() {
const api = new sst.aws.ApiGatewayV1("MyApiV1");
api.route("GET /", {
handler: "functions/apiv2/index.handler",
link: [bucket],
});
api.deploy();
return api;
}

function addApiV2() {
const api = new sst.aws.ApiGatewayV2("MyApiV2", {
link: [bucket],
Expand Down

0 comments on commit 6ea6828

Please sign in to comment.