@comicrelief/lambda-wrapper 1.9.1 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -82,6 +82,7 @@ The URL is likely to be your localhost URL and the next available port from the
82
82
  Use this mode by setting `LAMBDA_WRAPPER_OFFLINE_SQS_MODE=local`. Messages will still be sent to an SQS queue, but using a locally simulated version instead of AWS. This allows you to test your service using a tool like Localstack.
83
83
 
84
84
  By default, messages will be sent to a SQS service running on `localhost:4576`. If you need to change the hostname, you can set `process.env.LAMBDA_WRAPPER_OFFLINE_SQS_HOST`.
85
+ Also, if you need to change the port, you can set `process.env.LAMBDA_WRAPPER_OFFLINE_SQS_PORT`.
85
86
 
86
87
  ### AWS SQS mode
87
88
 
@@ -89,6 +89,7 @@ class SQSService extends _DependencyAware.default {
89
89
  super(di);
90
90
  const {
91
91
  LAMBDA_WRAPPER_OFFLINE_SQS_HOST: offlineHost = 'localhost',
92
+ LAMBDA_WRAPPER_OFFLINE_SQS_PORT: offlinePort = '4576',
92
93
  LAMBDA_WRAPPER_OFFLINE_SQS_MODE: offlineMode = SQS_OFFLINE_MODES.DIRECT,
93
94
  AWS_ACCOUNT_ID,
94
95
  REGION
@@ -110,7 +111,7 @@ class SQSService extends _DependencyAware.default {
110
111
  Object.keys(queues).forEach(queueDefinition => {
111
112
  if (container.isOffline && offlineMode === SQS_OFFLINE_MODES.LOCAL) {
112
113
  // custom URL when using an offline SQS service such as Localstack
113
- this.queues[queueDefinition] = `http://${offlineHost}:4576/queue/${queues[queueDefinition]}`;
114
+ this.queues[queueDefinition] = `http://${offlineHost}:${offlinePort}/queue/${queues[queueDefinition]}`;
114
115
  } else {
115
116
  // default AWS queue URL
116
117
  this.queues[queueDefinition] = `https://sqs.${REGION}.amazonaws.com/${accountId}/${queues[queueDefinition]}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comicrelief/lambda-wrapper",
3
- "version": "1.9.1",
3
+ "version": "1.10.0",
4
4
  "description": "Lambda wrapper for all Comic Relief Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {