1.0.3 • Published 3 years ago

@harshppatel/nestjs-themoviedb-api v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Introduction

This is a simple NestJS wrapper of node-themoviedb. This repo supports all the endpoints from the library. If I missed anything, Contribute! Looking forward to your PR/issue!

Installation

npm i @harshppatel/nestjs-themoviedb-api node-themoviedb

Usage

Importing Module:

import { TheMovieDbModule } from '@harshppatel/nestjs-themoviedb-api';

@Module({
  imports: [
    TheMovieDbModule.forRoot({
      API_KEY: '<Your API_KEY>', // You can also pass `language` option from node-themoviedb library
    }),
  ],
  providers: [],
  exports: [],
})
export class YourModule {}

Importing Module Async:

import { TheMovieDbModule } from '@harshppatel/nestjs-themoviedb-api';

@Module({
  imports: [
    TheMovieDbModule.forAsyncRoot({
      useFactory: async () => {
        return {
          API_KEY: '<Your API_KEY>', // You can also pass `language` option from node-themoviedb library
        };
      },
    }),
  ],
  providers: [],
  exports: [],
})
export class YourModule {}

Endpoint Example

Here is an example on how to use an endpoint from node-themoviedb library. You can learn more about these endpoints here.

import { TheMovieDbService } from '@harshppatel/nestjs-themoviedb-api';

@Injectable()
export class YourService {
  constructor(private readonly theMovieDbService: TheMovieDbService) {}

  async getHello() {
    const args = {
      pathParameters: {
        movie_id: 384018,
      },
    };
    return await this.theMoviedbService.getMovieEndpoint().getDetails(args);
  }
}

Change Log

See Changelog for more information.

Contributing

Contributions welcome! See Contributing.

Author

Harsh Patel (YouTube Channel)

License

Licensed under the MIT License - see the LICENSE file for details.

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago