@octacondeveloper/ajala
v0.2.3
Published
NestJS wrapper for axios for glade finance
Downloads
39
Readme
NestJS AJALA
Description
An axios wrapper for Nest originally published as part of the @nestjs/common
package. This package is a developed for making http calls for glade internal services.
Installation
$ npm i --save @octacondeveloper/ajala
Quick Start
Once the installation process is complete, to use the AjalaService
, first import AjalaModule
.
@Module({
imports: [AjalaModule],
providers: [AppService],
})
export class AppModule {}
Next, inject AjalaService
using normal constructor injection.
@Injectable()
export class AppService {
constructor(private readonly ajalaService: AjalaService) {}
async findAll(): Promise<any> {
return await this.ajalaService.get("https://jsonplaceholder.typicode.com/posts/11", [], body, false, null);
}
//sample payload structure
//this.ajalaService.get(url, header, body, proxy, options)
}
Other methods include
this.ajalaService.get("https://jsonplaceholder.typicode.com/posts/11", [], body, false, null);
this.ajalaService.delete("https://jsonplaceholder.typicode.com/posts/11", [], body, false, null);
this.ajalaService.put("https://jsonplaceholder.typicode.com/posts/11", [], body, false, null);
this.ajalaService.patch("https://jsonplaceholder.typicode.com/posts/11", [], body, false, null);
this.ajalaService.head("https://jsonplaceholder.typicode.com/posts/11", [], body, false, null);
this.ajalaService.post("https://jsonplaceholder.typicode.com/posts/11", [], body, false, null, files);
License
Ajala is MIT licensed.