You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Create router and add a single route returning "Hello" in its body
11
+
let router =Router(context: AppRequestContext.self)
12
+
router.get("hello") { _, _in
13
+
return"Hello"
23
14
}
15
+
// create lambda using router and run
16
+
let lambda =APIGatewayV2LambdaFunction(router: router)
17
+
tryawait lambda.runService()
24
18
```
25
-
26
-
The `Event` and `Output` types define your input and output objects. If you are using an `APIGateway` REST interface to invoke your Lambda then set these to `APIGatewayRequest` and `APIGatewayResponse` respectively. If you are using an `APIGateway` HTML interface then set these to `APIGatewayV2Request` and `APIGatewayV2Response`. If you are using any other `Event`/`Output` types you will need to implement the `request(context:application:from:)` and `output(from:)` methods yourself.
0 commit comments