Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/fjodor-rybakov/call-of-duty-nestjs
- Owner: fjodor-rybakov
- Created: 2020-08-22T21:44:18.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-23T08:35:11.000Z (about 4 years ago)
- Last Synced: 2024-04-23T02:58:14.266Z (7 months ago)
- Language: TypeScript
- Size: 126 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[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.
## 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).