0

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

With api prefix

Without 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;
  }
}

1 Answer 1

0

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

app.setGlobalPrefix('api', {
    exclude: [
      {
        path: '.well-known/apple-app-site-association',
        method: RequestMethod.GET,
      },
    ],
  });

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.