Skip to content

Instantly share code, notes, and snippets.

@rjpkuyper
Created February 3, 2023 06:37
Show Gist options
  • Save rjpkuyper/c395c8d2856c55afb8b21a367e9aaf1c to your computer and use it in GitHub Desktop.
Save rjpkuyper/c395c8d2856c55afb8b21a367e9aaf1c to your computer and use it in GitHub Desktop.
Dynamic controllers, an example.
// dynamic.controller.ts
export const createDynamicController = ({ customPath }): Type<any> {
@Controller()
class MyController {
constructor(private service: MyService) { }
@Get([customPath])
async getSomething(@Res() res: Response) {
//...
}
}
return MyController
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment