get params in controller

nestjs Контроллер, GET парамертры и параметры URL - пример

Получать GET-параметры и параметры из замого адреса запроса можно так (пример контроллера):

import { Controller, Get, Param, Query } from '@nestjs/common';

@Controller('test')
export class TestController {

  @Get('queryparams/:id')
  getTestGetparams(@Param('id') id, @Query('type') type): string {
    return `Url param: ${id}, Get param type = ${type}`;
  }
}

Валидация Get параметров с помощью joi (пример для Enum)

Пример:

Subscribe to RSS - get params in controller