@beincom/zanc
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads Coverage Discord Backers on Open Collective Sponsors on Open Collective

Description

Application states management module for Nest.

Installation

$ npm i --save @beincom/zanc

Quick Start

import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { AppStatesModule } from '@beincom/zanc';

import { AppService } from './app.service';
import { AppController } from './app.controller';

@Module({
  imports: [
    MongooseModule.forRoot(
      'mongodb://root:root@localhost:2379/?retryWrites=true&w=majority',
      {
        dbName: 'mydatabase',
      },
    ),
    AppStatesModule.forRootAsync({
      name: 'api-service',
      controllerOptions: {
        basePath: 'app-states',
        secretKey: '9b688bd4-9971-4661-bbb0-03f691bc5874',
      },
      useFactory: () => {
        return {
          notifier: {
            channel: 'sync-app-states',
            redisOptions: {
              host: '127.0.0.1',
              port: 6379,
            },
          },
        };
      },
    }),
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}

Stay in touch

License

Library is MIT licensed.

Readme

Keywords

none

Package Sidebar

Install

npm i @beincom/zanc

Weekly Downloads

120

Version

0.0.2

License

MIT

Unpacked Size

46.8 kB

Total Files

61

Last publish

Collaborators

  • huyvu-bic
  • vietkhiem-bic
  • bicnpmmember
  • bicnpmadmin
  • thanhlam-bic
  • phuongnamevol
  • nguyenthi
  • quangminh-bic
  • hoangquocviet
  • nhuphuoc
  • thienna-beincomm
  • minhtrong
  • minhdat
  • thevan-beincom