![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@springworks/api-client
Advanced tools
Module for sending requests to other APIs through a circuit breaker created by @springworks/circuit-breaker-factory.
createClient(base_url, circuit_breaker_config, logger, opt_auth)
Creates a api client using the provided config. Returns an object that exposes a sendRequest(opts, callback)
function.
base_url
Fully qualified uri string used as the base url
Config
The circuit breaker config. Please refer to this documentation for details.
Logger
opt_auth
Optional authentication object that will be used for all requests sent towards the provided base_url
. If there is an auth property in the options
send in sendRequest
then opt_auth
gets overwritten.
sendRequest(options, expected_status_codes, callback)
Options
Parameter | Description | Type | Required |
---|---|---|---|
endpoint_uri | URI of the endpoint that's to be reached | string | Yes |
The rest of the options match the options from the request HTTP client module and can be seen there.
expected_status_codes
Type | Description | Entries Type | Entries Range | Required |
---|---|---|---|---|
Array | Expected status codes by the invoker of this function | Number | [100, 500) | Yes |
Example Usage
var api_client_factory = require('api-client');
var config = {
source_name: 'my-api',
target_name: 'facebook-graph-api',
window_duration: 1000,
num_buckets: 10,
timeout_duration: 3000,
error_threshold: 50,
volume_threshold: 5
};
var api_client = api_client_factory.create('http://api.machinetohuman.com', config, bunyan_logger);
var options = {
endpoint: '/vehicles/1234'
};
api_client.sendRequest(options, [200, 404] function(err, res, body) {
// do your thing;
});
FAQs
Module for sending requests to other APIs through a circuit breaker
We found that @springworks/api-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.