Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const apiGatewayManager = new ApiGatewayManagementApi({
...(process.env.IS_OFFLINE
? {
endpoint: 'http://localhost:3001',
}
: {}),
});
const dynamoDbClient = new DynamoDB.DocumentClient({
...(process.env.IS_OFFLINE
? {
endpoint: 'http://localhost:8000',
}
: {}),
});
const eventStore = new DynamoDBEventStore({ dynamoDbClient });
const pubSub = new PubSub({ eventStore });
const subscriptionManager = new DynamoDBSubscriptionManager({ dynamoDbClient });
const connectionManager = new DynamoDBConnectionManager({
apiGatewayManager,
dynamoDbClient,
subscriptions: subscriptionManager,
});
type MessageType = 'greeting' | 'test';
type Message = {
id: string;
text: string;
type: MessageType;
};