Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function url support #190

Closed
wants to merge 11 commits into from
Closed

Conversation

dza89
Copy link

@dza89 dza89 commented Sep 9, 2023

Description of changes:

This PR adds function url support for go fiber and http.

@dza89 dza89 changed the title Add function url support for fiber Add function url support Sep 17, 2023
@suntong
Copy link

suntong commented Oct 16, 2023

How to make use of it please @dza89?

I've forked your PR as my copy -- github.com/suntong/aws-lambda-go-api-proxy

image

$ grep replace go.mod
replace github.com/awslabs/aws-lambda-go-api-proxy => github.com/suntong/aws-lambda-go-api-proxy v0.0.0-20230922211856-09c9b90f1fd1

But for the following code:

// import ...
        fiberadapter "github.com/awslabs/aws-lambda-go-api-proxy/fiber"
//...

// Handler will deal with Fiber working with Lambda
func Handler(ctx context.Context, req events.LambdaFunctionURLRequest) (events.LambdaFunctionURLResponse, error) {
        // If no name is provided in the HTTP request body, throw an error
        return fiberLambda.ProxyFunctionURLWithContext(ctx, req)
}

func main() {
        // Make the handler available for Remote Procedure Call by AWS Lambda
        lambda.Start(Handler)
}

I'm getting
./main.go:32:21: fiberLambda.ProxyFunctionURLWithContext undefined (type *fiberadapter.FiberLambda has no field or method ProxyFunctionURLWithContext)

What I've done wrong, do you have a working code that I could try with please? thx

@dza89
Copy link
Author

dza89 commented Oct 17, 2023

@suntong
Copy link

suntong commented Oct 17, 2023

Ah, yeah, now is working. thanks.

@drone-ah
Copy link

drone-ah commented Nov 8, 2023

Hi,

Thanks for the progress on this! I, however, need gin 😉 Looks simple enough to add in though - so I can probably make the changes tomorrow/Friday. Assuming I am successful, how would you like me to get the changes over to you so you can add it into this PR?

Thanks,

@dza89
Copy link
Author

dza89 commented Nov 8, 2023

If you fork my fork and make a new pr I'll close this one.

@suntong
Copy link

suntong commented Nov 8, 2023

If you fork my fork and make a new pr I'll close this one.

Please don't close this one, as I'm still hoping the function url support for go fiber will be adopted by the official code someday, eventually...

@suntong
Copy link

suntong commented Nov 8, 2023

Oh, I know what you mean, you meant two changes in single PR. Ok. if so, sure.

@dza89
Copy link
Author

dza89 commented Nov 8, 2023

Haha then the post from you under #187 should be under this one?

@suntong
Copy link

suntong commented Nov 9, 2023

Haha, I re-read my post under #187, and now made it crystal clear what I meant (but won't repeat it under here for I'm afraid beating a dead horse won't gain us anything 🤦🏻‍♂️🤦🏻‍♂️).

@drone-ah
Copy link

drone-ah commented Nov 9, 2023

Hi,

I've managed to get it working with gin and have tested it (both with added tests and a test deployed lambda with fURL).

I have opened a PR (#192) with the updates (forked from this branch, so includes all changes from #190 and #187), but am happy to close that down if there is an alternative way to get the changes in.

Thanks again, and please let me know if I can be of any further assistance.

Best Wishes,

@dza89
Copy link
Author

dza89 commented Nov 9, 2023

superseeded by #192

@dza89 dza89 closed this Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants