@lindorm-io/koa-axios
v0.1.54
Published
Axios Request Handler middleware for @lindorm-io/koa applications
Downloads
17
Readme
@lindorm-io/koa-axios
Axios Request Handler middleware for @lindorm-io/koa applications.
Installation
npm install --save @lindorm-io/koa-axios
Peer Dependencies
This package has the following peer dependencies:
Usage
koaApp.addMiddleware(
axiosMiddleware({
baseUrl: "https://lindorm.io/", // optional [string]
basicAuth: {
// optional [object]
username: "username",
password: "password",
},
clientName: "axiosClient", // required [string]
middleware: [], // optional [Array<AxiosMiddleware>]
}),
);
const response = await ctx.axios.axiosClient.get("/path");