Product
Introducing Ruby Support in Socket
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
@aws-sdk/middleware-endpoint
Advanced tools
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-endpoint/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-endpoint) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-endpoint.svg)](https://www.npmjs.com/pac
The @aws-sdk/middleware-endpoint package is part of the AWS SDK for JavaScript v3. It is used to manage and resolve endpoints in AWS service calls. This middleware allows developers to customize endpoint resolution logic, which can be useful for directing requests to specific regions, using custom domain names, or working with mock endpoints for testing purposes.
Custom Endpoint Resolution
This code demonstrates how to use the @aws-sdk/middleware-endpoint package to customize the endpoint for an S3 client. It adds a middleware that resolves to a custom endpoint, which is useful for directing requests to a specific server or for testing with mock endpoints.
const { S3Client, GetObjectCommand } = require('@aws-sdk/client-s3');
const { endpointMiddleware } = require('@aws-sdk/middleware-endpoint');
const client = new S3Client({
region: 'us-west-2'
});
client.middlewareStack.add(endpointMiddleware({
endpoint: () => ({
protocol: 'https:',
hostname: 'my-custom-s3-endpoint.com',
path: '/',
query: {}
})
}), {
step: 'build'
});
const command = new GetObjectCommand({ Bucket: 'example-bucket', Key: 'example-object' });
client.send(command);
This package provides middleware for handling retries of requests in AWS SDK for JavaScript v3. It is similar to @aws-sdk/middleware-endpoint in that it modifies the request handling pipeline, but it focuses on retry logic rather than endpoint resolution.
The @aws-sdk/middleware-logger package allows logging of requests and responses in the AWS SDK for JavaScript v3. Like @aws-sdk/middleware-endpoint, it enhances the SDK's capabilities by adding middleware that intercepts and logs all service interactions, although its primary focus is on logging rather than endpoint management.
3.289.0 (2023-03-10)
FAQs
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-endpoint/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-endpoint) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-endpoint.svg)](https://www.npmjs.com/pac
The npm package @aws-sdk/middleware-endpoint receives a total of 953,725 weekly downloads. As such, @aws-sdk/middleware-endpoint popularity was classified as popular.
We found that @aws-sdk/middleware-endpoint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.