A simple middleware service for axios HTTP requests. Version 0.4.0 is the final release as the package is deprecated. It allows intercepting axios requests and responses via middleware functions, supporting async handlers and custom adapters. Key differentiators: a clean middleware pattern with onRequest/onResponse/onSync hooks, vs axios's native interceptors. Requires axios >=0.17.1 <1.2.0. The package is unmaintained and alternatives should be considered.
npm install ax-middlewareVerified import paths — ran on the pinned version, not inferred.
Shows how to create a middleware service, register a middleware with request/response/sync handlers, and use axios normally.
Migrate to a maintained alternative like axios interceptors or a modern HTTP client library (e.g., ky, got).
Change any middleware defined as class MyMiddleware extends HttpMiddleware to a plain object with onRequest/onResponse/onSync methods.
Update middleware handlers to use the new 'on' prefix naming convention.
Run 'npm install axios-middleware' (ensure axios is also installed as a peer dependency).
Use a plain object for middleware instead of a class inheriting from HttpMiddleware.
Ensure you instantiate service with: new HttpMiddlewareService(axios).
No dependency data recorded yet.