1.0.0 • Published 2 years ago

nestjs-axios-promise v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Nest.js Axios Promise

GitHub Workflow Status Test Coverage Maintainability GitHub package.json version NPM Downloads

A thin wrapper around Axios for Nest.js using Promises.

Install

pnpm add nestjs-axios-promise

Usage

import { AxiosService } from "./axios.service";

@Module({
  imports: [AxiosModule.register()],
  providers: [MyCustomService],
})
export class AppModule {}
@Injectable()
export class MyCustomService {
  constructor(private readonly http: AxiosService) {}

  async doWork() {
    const response = await this.http.get("/");
    console.log(response);
  }
}

Custom Config

@Module({
  imports: [
    AxiosModule.register({
      baseURL: "https://example.com",
      headers: {
        "X-My-Header": "Is a value!",
      },
    }),
  ],
})
export class AppModule {}
1.0.0

2 years ago

1.0.0-rc.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago