4.1.0 • Published 7 months ago

@qiwi/nestjs-enterprise-svc-info v4.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
7 months ago

@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 {}

Docs

3.0.0

9 months ago

4.1.0

7 months ago

4.0.1

8 months ago

4.0.0

8 months ago

2.0.5

11 months ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

2 years ago

1.4.1

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.4.0

2 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

4 years ago

1.0.0

4 years ago