diff --git a/swagger-config/transactional/javascript/templates/ApiClient.mustache b/swagger-config/transactional/javascript/templates/ApiClient.mustache index ac8301a..b27b385 100644 --- a/swagger-config/transactional/javascript/templates/ApiClient.mustache +++ b/swagger-config/transactional/javascript/templates/ApiClient.mustache @@ -1,7 +1,10 @@ {{>licenseInfo}} var axios = require('axios'); -axios.defaults.timeout = 300000; // 300s +var axiosInstance = axios.create({ + timeout: 300000 // 300s +}); + {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{#-first}}var {{baseName}} = require('./api/{{classname}}'); {{/-first}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} @@ -47,7 +50,7 @@ exports.prototype.post = function post(path, body = {}) { url = url + '.' + defaultOutputFormat; } - return axios + return axiosInstance .post(url, body) .then(function (response) { return response.data; @@ -66,7 +69,7 @@ exports.prototype.setDefaultOutputFormat = function (outputFormat) { }; exports.prototype.setDefaultTimeoutMs = function (timeoutMs) { - axios.defaults.timeout = timeoutMs; + axiosInstance.defaults.timeout = timeoutMs; } // The default API client implementation.