dougmoscrop / serverless-http

Use your existing middleware framework (e.g. Express, Koa) in AWS Lambda πŸŽ‰
Other
1.71k stars 164 forks source link

Support for the new feature AWS Lambda URLs #234

Open ixartz opened 2 years ago

ixartz commented 2 years ago

Hi there,

AWS has recently announce a new feature: https://aws.amazon.com/blogs/aws/announcing-aws-lambda-function-urls-built-in-https-endpoints-for-single-function-microservices/ And, Serverless Framework has also added support this: https://www.serverless.com/blog/aws-lambda-function-urls-with-serverless-framework

I have tried this feature with serverless-http and it doesn't seems to work. The server doesn't start:

DOTENV: Loading environment variables from .env.development:
Bundling with Webpack...
Watching for changes...

Starting Offline at stage dev (us-east-1)

Issues checking in progress...
Offline [http for lambda] listening on http://localhost:3002
Function names exposed for local invocation by aws-sdk:
           * app: serverless-boilerplate-offline-app
No issues found.

Using the previous configuration I got this message when the server is ready:

Server ready: http://localhost:4000 πŸš€

Enter "rp" to replay the last request
No issues found.

This message never appears with the new function: AWS Lambda URLs.

mjoynes-14four commented 2 years ago

I was able to get it to work with ExpressJS but it's not returning a response.

mjoynes-14four commented 2 years ago

Actually, if you modify their example to return context.res it returns the response as it should.