0.1.0-alpha.23 • Published 11 months ago

@zarja/http v0.1.0-alpha.23

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Usage

// modules/app.module.ts
import { createLoggerConfig, ZarjaHttp } from '@zarja/http'
import { NestFactory, Module } from '@nestjs/common'
import { LoggerModule } from 'nestjs-pino'
import { config } from '../common/config' // Environment configuration

async function createApp() {
  const app = NestFactory.create(AppModule, { bufferLogs: true })

  ZarjaHttp.setup(app, {
    serialization: {
      serializeResponses: true,
      excludeNullFromResponse: true
    },
    logger: config.logger
  })

  return app
}

@Module({
  import: [
    LoggerModule.forRootAsync(createLoggerConfig(config.logger)),
    // ...
  ]
})
export class AppModule {}
// main.ts
import { createApp } from './modules/app.module'

createApp().then(app => app.start())
0.1.0-alpha.23

11 months ago

0.1.0-alpha.22

11 months ago

0.1.0-alpha.21

11 months ago

0.1.0-alpha.20

11 months ago

0.1.0-alpha.19

11 months ago