mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 12:42:58 +08:00
Make QueueUrl optional, as it can have a default value that is be obtained from aws.SQS:
```
var sqs = new aws.SQS({
region: config.aws.region,
accessKeyId: config.aws.accessID,
secretAccessKey: config.aws.secretKey,
// For every request in this demo, I'm going to be using the same QueueUrl; so,
// rather than explicitly defining it on every request, I can set it here as the
// default QueueUrl to be automatically appended to every request.
params: {
QueueUrl: config.aws.queueUrl
}
});
var sendMessage = Q.nbind( sqs.sendMessage, sqs );
// ---------------------------------------------------------- //
// ---------------------------------------------------------- //
// Now that we have a Q-ified method, we can send the message.
sendMessage({
MessageBody: "This is my first ever SQS request... evar!"
})
```
Based on:
http://www.bennadel.com/blog/2792-shedding-the-monolithic-application-with-aws-simple-queue-service-sqs-and-node-js.htm