0.0.7 • Published 2 years ago

@softkit/platform-client v0.0.7

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Platform Http Client Library

This library provides a simple http client for the platform application.

It's auto generated using openapi-generator.

Installation

yarn add @softkit/platform-client

Usage

Add to your env.yml file

platformClient:
  url: http://localhost:9999
  serviceName: platform

Update your root.config.ts, it needs to implement the appropriate config interface

import { HttpClientConfig } from '@softkit/server-http-client';
import { PlatformClientConfig } from '@softkit/platform-client';

export default class RootConfig implements PlatformClientConfig {

  @Type(() => HttpClientConfig)
  @ValidateNested()
  public readonly platformClient!: HttpClientConfig;

}

Import PlatformClientModule in your main module


That's it, api clients will be available in your DI container, you can simply inject it in constructor

import { RolesApi } from '@softkit/platform-client';

@Injectable()
export default class MyServiceThatNeedRolesApi {

  constructor(
    private readonly rolesApi: RolesApi,
  ) {}

}
0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago