Skip to content

Commit 0f70aa0

Browse files
committed
Applied code review feedback.
1 parent 1096440 commit 0f70aa0

File tree

1 file changed

+2
-35
lines changed
  • Libraries/src/Amazon.Lambda.AspNetCoreServer.Hosting

1 file changed

+2
-35
lines changed

Libraries/src/Amazon.Lambda.AspNetCoreServer.Hosting/README.md

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -51,38 +51,7 @@ app.Run();
5151

5252
## Handler Configuration
5353

54-
When deploying your Lambda function, the handler configuration depends on your project structure.
55-
56-
### Executable Mode (Recommended)
57-
58-
For executable mode, use `AssemblyName` as the handler (e.g., `MyLambdaProject`). This mode works with top-level statements or a `Main()` method without parameters. The Lambda runtime client handles event routing automatically.
59-
60-
### Class Library Mode
61-
62-
For class library mode, use `AssemblyName::ClassName::MethodName` as the handler. This mode works with traditional class-based handlers and uses reflection-based method invocation.
63-
<<<<<<< HEAD
64-
65-
### Common Configuration Issue
66-
67-
When using `Main(string[] args)` with executable mode handler configuration, the Lambda runtime attempts to deserialize the incoming API Gateway event JSON into the `string[] args` parameter, which causes a `JsonSerializerException`.
68-
69-
Incorrect usage:
70-
```csharp
71-
static void Main(string[] args)
72-
{
73-
var builder = WebApplication.CreateBuilder(args);
74-
// ... rest of setup
75-
}
76-
```
77-
78-
Correct usage for executable mode:
79-
```csharp
80-
static void Main()
81-
{
82-
var builder = WebApplication.CreateBuilder();
83-
// ... rest of setup
84-
}
85-
```
54+
The Lambda function handler must be set to the assembly name (e.g., `MyLambdaProject`). The `AddAWSLambdaHosting` method sets up the Lambda runtime client and registers the callback for processing Lambda events, so the handler should not use the class library format (`<assembly-name>::<full-type-name>::<method-name>`).
8655

8756
## Extension Points
8857

@@ -144,6 +113,4 @@ builder.Services.AddAWSLambdaHosting(LambdaEventSource.HttpApi, options =>
144113
apiResponse.Headers ??= new Dictionary<string, string>();
145114
apiResponse.Headers["X-Request-Id"] = context.AwsRequestId;
146115
};
147-
});
148-
=======
149-
>>>>>>> 76224107 (Applied code review feedback)
116+
});

0 commit comments

Comments
 (0)