How to use the @phenyl/utils.PhenylRestApiDirectClient function in @phenyl/utils

To help you get started, we’ve selected a few @phenyl/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github phenyl / phenyl / modules / http-rules / src / server-logic.ts View on Github external
async handleCustomRequest(encodedHttpRequest: EncodedHttpRequest) {
    try {
      const restApiClient = new PhenylRestApiDirectClient(this.restApiHandler);
      const customResponse = await this.customRequestHandler(
        encodedHttpRequest,
        restApiClient
      );
      return customResponse;
    } catch (err) {
      // TODO: Show error in development environment.
      const body = "Internal Server Error.";
      return createPlainTextResponse(body, 500);
    }
  }
}
github phenyl / phenyl / modules / rest-api / src / phenyl-rest-api.ts View on Github external
public createDirectClient(): PhenylRestApiDirectClient {
    return new PhenylRestApiDirectClient(this);
  }