Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Last active October 20, 2021 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/21d9869277e05c57044ee4c55884f080 to your computer and use it in GitHub Desktop.
Save velotiotech/21d9869277e05c57044ee4c55884f080 to your computer and use it in GitHub Desktop.
const endpoint = process.env.IS_OFFLINE ? 'http://localhost:3001' : process.env.PUBLISH_ENDPOINT;
console.log('publish endpoint', endpoint);
const gatewayClient = new ApiGatewayManagementApi({
apiVersion: '2018-11-29',
credentials: config,
endpoint,
});
return gatewayClient
.postToConnection({
ConnectionId: this.connectionId,
Data: JSON.stringify(message),
})
.promise();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment