11import { StackContext , Api , EventBus , App } from "sst/constructs" ;
22import { LayerVersion } from "aws-cdk-lib/aws-lambda" ;
33
4+
5+ function magicShit ( api ) {
6+ console . log ( api )
7+ }
48export function API ( { stack } : StackContext ) {
59
610 const baselime = LayerVersion . fromLayerVersionArn (
711 stack ,
812 "BaselimeLayer" ,
9- `arn:aws:lambda:eu-west-2:097948374213 :layer:baselime-node:2 `
13+ `arn:aws:lambda:eu-west-2:374211872663 :layer:baselime-node:7 `
1014 ) ;
1115
1216 if ( ! ( stack . node . scope as App ) ?. local ) {
@@ -15,7 +19,8 @@ export function API({ stack }: StackContext) {
1519 AWS_LAMBDA_EXEC_WRAPPER : '/opt/baselime' ,
1620 BASELIME_KEY : process . env . BASELIME_KEY as string ,
1721 COLLECTOR_URL : 'https://otel.baselime.cc/v1' ,
18- OTEL_LOG_LEVEL : 'debug'
22+ OTEL_LOG_LEVEL : 'debug' ,
23+ BASELIME_ORIGINAL_HANDLER : 'packages/functions/src/todo.handler' ,
1924 } ) ;
2025
2126 }
@@ -40,10 +45,11 @@ export function API({ stack }: StackContext) {
4045 } ,
4146 routes : {
4247 "GET /" : "packages/functions/src/todo.handler" ,
43- "POST /" : "packages/functions/src/todo.handler" ,
4448 } ,
4549 } ) ;
4650
51+ magicShit ( api ) ;
52+
4753 bus . subscribe ( "todo.created" , {
4854 handler : "packages/functions/src/events/todo-created.handler" ,
4955 } ) ;
0 commit comments