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

228
Views
How can set many globalprefix for nestjs project

I want set many Global Prefix for my app like this :

admin/products
admin/users
admin/...

api/products
api/search
api/...

shop/products
shop/cart
shop/...

i can set one globalprefix into main.ts app.setGlobalPrefix('api')

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Use app.setGlobalPrefix('api') only for a global prefix. If you want the same prefix for many controllers, you must write it in each controller, like:

@Controller('shop/products')

You can also define a constant somewhere and reuse it every time:

const shopPrefix: string = 'shop';    
@Controller(`${shop}/products`)
about 4 years ago · Juan Pablo Isaza Report
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!