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!
npm i @harshppatel/nestjs-themoviedb-api node-themoviedb
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 {}
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);
}
}
See Changelog for more information.
Contributions welcome! See Contributing.
Harsh Patel (YouTube Channel)
Licensed under the MIT License - see the LICENSE file for details.