~repos /gromer
git clone https://pyrossh.dev/repos/gromer.git
gromer is a framework and cli to build multipage web apps in golang using htmx and alpinejs.
97654670
—
pyros2097 4 years ago
fix lambda handler
router.go
CHANGED
|
@@ -942,7 +942,7 @@ func (r *Router) getPage(ui UI) string {
|
|
|
942
942
|
return b.String()
|
|
943
943
|
}
|
|
944
944
|
|
|
945
|
-
func (r *Router) Lambda(ctx context.Context, e events.APIGatewayV2HTTPRequest) (res lambdaResponse) {
|
|
945
|
+
func (r *Router) Lambda(ctx context.Context, e events.APIGatewayV2HTTPRequest) (res lambdaResponse, err error) {
|
|
946
946
|
res.StatusCode = 200
|
|
947
947
|
res.Headers = map[string]string{
|
|
948
948
|
"Content-Type": "text/html",
|
|
@@ -950,7 +950,6 @@ func (r *Router) Lambda(ctx context.Context, e events.APIGatewayV2HTTPRequest) (
|
|
|
950
950
|
// Handle errors
|
|
951
951
|
defer func() {
|
|
952
952
|
if rcv := recover(); rcv != nil {
|
|
953
|
-
var err error
|
|
954
953
|
switch x := rcv.(type) {
|
|
955
954
|
case string:
|
|
956
955
|
err = errors.New(x)
|