2.1.5 • Published 4 months ago

@iamnnort/nestjs-request v2.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Info

Request module for NestJS - Simple - Informative - Pretty

Installation

yarn add @iamnnort/nestjs-request

Usage

// app.controller.ts
import { Controller, Get } from '@nestjs/common';
import { RequestService } from '@iamnnort/nestjs-request';

@Controller('demo')
export class AppController {
  constructor(private requestService: RequestService<{ id: number }>) {}

  @Get()
  demo() {
    return this.requestService.get(1);
  }
}

// app.ts
import { Module } from '@nestjs/common';
import { RequestModule } from '@iamnnort/nestjs-request';
import { AppController } from './app.controller';

@Module({
  imports: [
    RequestModule.register({
      name: 'Demo Api',
      baseUrl: 'https://jsonplaceholder.typicode.com',
      url: '/todos',
      logger: true,
    }),
  ],
  controllers: [AppController],
})
export class AppModule {}

// index.ts
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app';

async function bootstrap() {
  const app = await NestFactory.create(AppModule, {
    bufferLogs: true,
  });

  await app.listen(3000);
}

bootstrap();

Output

[Demo Api] [Request] GET /todos/1
[Demo Api] [Response] GET /todos/1 200 OK {"userId":1,"id":1,"title":"delectus aut autem","completed":false}

License

This project is licensed under the MIT license. See the LICENSE file for more info.

1.4.5

7 months ago

1.3.6

10 months ago

1.2.7

12 months ago

1.4.4

7 months ago

1.4.3

7 months ago

1.3.4

10 months ago

1.4.2

9 months ago

1.3.3

11 months ago

1.3.2

12 months ago

1.4.0

10 months ago

1.3.1

12 months ago

2.1.2

6 months ago

2.1.1

6 months ago

2.0.2

6 months ago

2.1.4

5 months ago

2.1.3

5 months ago

2.1.5

4 months ago

2.0.1

7 months ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.1.20

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago