Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SentryMan committed Sep 6, 2024
1 parent f91351d commit 3b52851
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,29 @@ public class LambdaRequestHandler
@Override
public AWSHttpResponse handleRequest(APIGatewayV2HttpEvent event, Context context) {

return handler.handle(event, context);
return handler.apply(event, context);
}
}
```

### Use with Dependency Injection

```java
public class LambdaRequestHandler
implements RequestHandler<APIGatewayV2HttpEvent, AWSHttpResponse> {

HttpFunction handler;

public LambdaRequestHandler() {

List<HttpService> services = // Retrieve HttpServices via DI;
handler = Sigma.create().routing(services).createHttpFunction();
}

@Override
public AWSHttpResponse handleRequest(APIGatewayV2HttpEvent event, Context context) {

return handler.apply(event, context);
}
}
```

0 comments on commit 3b52851

Please sign in to comment.