Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fjodor-rybakov/call-of-duty-nestjs


https://github.com/fjodor-rybakov/call-of-duty-nestjs

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        


Nest Logo

[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
[travis-url]: https://travis-ci.org/nestjs/nest
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
[linux-url]: https://travis-ci.org/nestjs/nest

A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.



NPM Version
Package License
NPM Downloads
Travis
Linux
Coverage
Gitter
Backers on Open Collective
Sponsors on Open Collective



## Description

NestJS package for Call Of Duty API

## Installation

```bash
$ npm install call-of-duty-nestjs
```
OR
```bash
$ yarn add call-of-duty-nestjs
```

## Overview
Configuration
```typescript
/*app.module.ts*/
import { ActivisionModule } from 'call-of-duty-nestjs';

@Module({
imports: [ActivisionModule.forRoot({
login: '',
password: '',
ratelimit: { maxRequests: 2, perMilliseconds: 1000, maxRPS: 2 } // Optional
})]
})
export class AppModule {
}
```
Or async
```typescript
/*app.module.ts*/
import { ActivisionModule } from 'call-of-duty-nestjs';

@Module({
imports: [ActivisionModule.forRootAsync({
useFactory: () => ({
login: '',
password: '',
ratelimit: { maxRequests: 2, perMilliseconds: 1000, maxRPS: 2 } // Optional
})
})]
})
export class AppModule {
}
```
Usage
```typescript
/*app.controller.ts*/

import { Injectable, Logger } from '@nestjs/common';
import {
ActivisionService,
BattleDataResponse,
MwDataResponse,
CombatDataResponse
} from 'call-of-duty-nestjs';

@Injectable()
export class AppController {
private readonly logger = new Logger(AppController.name);

constructor(
private readonly activisionService: ActivisionService
) {
}

/**
* Get combat multiplayer data
*/
getMWBattleData(): Promise {
return this.activisionService.MWBattleData({
platform: '',
playerName: ''
});
}

/**
* Get combat warzone data
*/
getMWstats(): Promise {
return this.activisionService.MWstats({
platform: '',
playerName: ''
});
}

/**
* Get multiplayer stats
*/
getMWmp(): Promise {
return this.activisionService.MWmp({
platform: '',
playerName: ''
});
}

/**
* Get all stats
*/
getMWcombatwz(): Promise {
return this.activisionService.MWcombatwz({
platform: '',
playerName: ''
});
}

/**
* Get battle data
*/
getMWcombatmp(): Promise {
return this.activisionService.MWcombatmp({
platform: '',
playerName: ''
});
}
}
```

## License

Nest is [MIT licensed](LICENSE).