Closed ivanguimam closed 4 years ago
I managed to solve part of my problem with this snippet of code:
const bannerController = DIContainer.get<BannerController>(TYPES.BannerController)
const termsController = DIContainer.get<TermsController>(TYPES.TermsController)
super.addControllers([bannerController, termsController])
this.app.use('/app', this.app._router)
But before I had a route /banner
, now I have two routes, one /banner
and another /app/banner
Just my two cents: @seanpmaxwell told me that his goal with OvernightJS is to add first-class TypeScript support to Express, not add additional features like prefixes.
In my project staart/api (Express/TypeScript starter for SaaS), I built on top of OvernightJS and added more opinionated features like prefix injection, async return support, etc. I think that's the best way for you too. 😉
Can I close this issue in that case
Closing issue
I have the same problem this issue https://github.com/seanpmaxwell/overnight/issues/48.
Only I'm using inversify to inject the services into my controllers, so I can't use a parent controller.
ControllerExample.ts
Server.ts