All my routes should have api prefix, except the .well-known route so I've added that path into the exclude option of the setGlobalPrefix method
app.setGlobalPrefix('api', { exclude: ['.well-known'] });
I've also tried to add it like this
app.setGlobalPrefix('api', { exclude: [{ path: '.well-known', method: RequestMethod.GET }] });
But it still works only works with API prefix


Here is my controller
@Controller('.well-known')
export class WellKnownController {
constructor(
@Inject(
CustomProviders.APPLE_APP_SITE_ASSOCIATION)
private readonly appleAppSiteAssociationFile: object,
) {}
@Get('apple-app-site-association')
async getAppleAppSiteAssociation() {
return this.appleAppSiteAssociationFile;
}
}
Exclude does not work because it cannot match the path value in the route. The problem is solved when you make it the same as your path in the route as in the code block below.
main.ts file