Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PostFunction:
- Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
- Properties:
- CodeUri: hello_world/
- Handler: apppost.lambda_handler
- Runtime: nodejs8.10
- Environment: # More info about Env Vars: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#environment-object
- Variables:
- PARAM1: VALUE
- Events:
- PostHello:
- Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
- Properties:
- Path: /posthello
- Method: post
- exports.lambda_handler = async (event, context, callback) => {
- try {
- response = {
- 'statusCode': 200,
- 'body': JSON.stringify({
- message: context,
- })
- }
- }
- catch (err) {
- console.log(err);
- callback(err, null);
- }
- callback(null, response)
- };
Add Comment
Please, Sign In to add comment