2.0.0 (2019-11-18)
-
postRequestMiddleWare:
postRequestMiddleWare
parameters has changed.To migrate the code follow the example below:
Before:
apiMod.registerPostRequestMiddleWare(apiMetas, res, next) { next(res); }
After:
apiMod.registerPostRequestMiddleWare(apiMetas, { data, response }, next) { console.log(data); next(response); }
v1.6.0 (2019-10-28)
- exports origin meta data by adding meta property to request.
v1.5.2 (2019-10-3)
- update dependencies and fix other potential security vulnerabilities
v1.5.1 (2019-6-13)
postRequestMiddle
typo error
v1.5.0 (2019-6-13)
- add
globalPostRequestMiddleWare
static method - add
registerPostRequestMiddleWare
instance method
v1.4.1 (2019-5-31)
- fix the bug that the
data
option would be parsed first before processing inforeRequestHook
function.
v1.4.0 (2019-5-29)
- ApiModule#
globalForeRequestMiddleWare
: method name changed fromregisterForeRequestMiddleWare
- ApiModule#
globalFallbackMiddleWare
: method name changed fromregisterFallbackMiddleWare
- registerFallbackMiddleWare(fallbackHook): change the second parameters to an object which contains
error
anddata
fields. axios
dependence: you need to installaxios
dependence bynpm i axios -S
additional, cause you can have better control of dependency version.
getAxios
: now return an axios instance byaxios.create(config)
- adding unit test and coverage test.
- better error tips when you passing invalid values to
apiMetas
or registering middlewares.
v1.3.2 (2019-4-2)
- fix default error handler would still be invoked when fallbackMiddle has been registered already.
v1.3.0 (2019-3-19)
baseConfig
: add baseConfig for creating axios by default configuration.