I'm setting up a aws-apigateway-lambda and i'm new in that services.
I'm Wondering that how to use lambda getting individual methods(POST,GET...)?
For instances,
- Create Individual lambda function per http method.
GET api.com -> lambda.api.get
POST api.com -> lambda.api.post
- one lambda function and Accept all method
- GET,POST,DELETE... api.com -> lambda.api
def lambda_function(event,context):
method = event["http-method"]
if method == 'GET': return receive_get()
elif method == 'POST': return receive_post()
which is efficient way ??
Aucun commentaire:
Enregistrer un commentaire