lambda aws syntax error : missing ) after argument list

  amazon-web-services, lambda, node.js, syntax-error, windows
const AWS = require('aws-sdk');
const ddb = new AWS.DynamoDB.DocumentClient({region: 'ap-southeast-1'})

exports.handler = async(event) => {
    //TODO implement
    var obj = JSON.parse(JSON.stringify(event.queryStringParameters));
    const requestId = context.awsRequestId;
    await createMessage(requestId).then(() => {
        callback(null, {
        statusCode: 200, 
        body:  `
            <hl>query string parameters</hl>
            <p>${JSON.stringify(event.queryStringParameters)}</p>
            <p>one: ${obj.one}</p>
            <hr/>
            <hl>path</hl>
            <p>${JSON.stringify(event.requestContext.http.path)}</p>
            <hr/>
         `, 
       header: {
            'Content-Type' :  'text/html; charset=uft-8',
        },
    }
function createMessage(requestId) {
     const params = {
        TableName: 'Message',
        Item: {
            'Hello' : 'one'
        }
     }
    return ddb.put(params).promise();
}; 

function createMessage(requestId) {
const params = {
TableName: ‘Message’,
Item: {
‘Hello’ : ‘one’
}
}
return ddb.put(params).promise();
};

Source: Windows Questions

LEAVE A COMMENT