Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
Nest JS diferencia 2 rutas distintas del mismo controlador

Tengo una aplicación Nest JS con 2 rutas que simplemente devuelve los datos (preferencias) de la base de datos.

Quiero crear 2 rutas:

  1. Lista de preferencias de elementos: /api/items
  2. Lista de preferencias de funciones: /api/features

Soy nuevo en NestJS. Estas 2 rutas deben estar bajo un módulo. ¿Es esto alcanzable?

La segunda ruta funciona, pero aparece un error que dice 404 No encontrado.

 @Module({ controllers: ['PreferenceController'], providers: ['PreferenceService'] })
 @Controller() export class PreferenceController{ constructor(private readonly preferenceService: PreferenceService) {} @Get('preference/:x/:y/:z') getItem(@Param() param) { return this.preferenceService.getItem(param); } @Get(':id') getFeature(@Param() param) { return this.preferenceService.getFeature(param); } }
 routes = [ path: '/api', children: [ { path: '/items', module: 'PreferenceModule' }, { path: '/features', module: 'PreferenceModule' } ] ]
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!