2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-11 18:02:32 +03:00

Adding request function to exported singleton

#316
This commit is contained in:
Joshua Egan
2016-05-17 14:54:34 -06:00
committed by Nick Uraltsev
parent 2e949495f0
commit 0d9996b1a0
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -78,7 +78,10 @@ Axios.prototype.request = function request(config) {
var defaultInstance = new Axios(defaults);
var axios = module.exports = bind(Axios.prototype.request, defaultInstance);
module.exports.Axios = Axios;
axios.request = bind(Axios.prototype.request, defaultInstance);
// Expose Axios class to allow class inheritance
axios.Axios = Axios;
// Expose properties from defaultInstance
axios.defaults = defaultInstance.defaults;