Network Pipe Manufacturer

    @qiwi/nestjs-enterprise-svc-info
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.3 • Public • Published

    @qiwi/nestjs-enterprise-svc-info

    Returns uptime by /svc-info/uptime, application name with version by /svc-info/version and build info by /svc-info/buildstamp

    Installation

    yarn add @qiwi/nestjs-enterprise-svc-info

    Before using

    Buildstamp is a file with build info, whose contents the module exposes by /svc-info/buildstamp.

    Set up buidstamp forwarding into a container in your Dockerfile:

    COPY buildstamp.json $APP_DIR/buildstamp.json

    Add to "scripts" in package.json:

    "prebuild": "<your script for generating buildstamp>",

    We suggest using buildstamp.

    Usage

    Usage as module:

    import { SvcInfoModule } from '@qiwi/nestjs-enterprise-svc-info'
    // ...
    
    @Module({
      imports: [
        SvcInfoModule
        // and so on
      ],
      controllers: [ ],
      providers: [ ],
    })
    export class AppModule {}

    Usage as controller (if you need routes order):

    import { SvcInfoController } from '@qiwi/nestjs-enterprise-svc-info'
    
    // ...
    
    @Module({
      imports: [],
      controllers: [SvcInfoController],
      providers: [ ],
    })
    export class AppModule {}

    Setting a custom path to buildstamp file

    If you want to give a custom path to your buildstamp file, import module via register, which accepts ISvcInfoModuleOpts:

    import { SvcInfoModule, ISvcInfoModuleOpts } from '@qiwi/nestjs-enterprise-svc-info'
    // ...
    const opts: ISvcInfoModuleOpts = {
      path: 'some/path/buildstamp.json'
    }
    
    @Module({
      imports: [
        SvcInfoModule.register(opts)
        // and so on
      ],
      controllers: [ ],
      providers: [ ],
    })
    export class AppModule {}

    In case of using the module as controller:

    import { SvcInfoController, ISvcInfoModuleOpts } from '@qiwi/nestjs-enterprise-svc-info'
    // ...
    const opts: ISvcInfoModuleOpts = {
      path: 'some/path/buildstamp.json'
    }
    
    
    @Module({
      imports: [],
      controllers: [SvcInfoController],
      providers: [
        { provide: 'ISvcInfoModuleOpts', useValue: opts }
      ],
    })
    export class AppModule {}

    Install

    npm i @qiwi/nestjs-enterprise-svc-info

    DownloadsWeekly Downloads

    24

    Version

    2.0.3

    License

    none

    Unpacked Size

    21.7 kB

    Total Files

    23

    Last publish

    Collaborators

    • antongolub
    • qiwibot
    • pismenskiy