Skip to content
/ zanc Public

Application states management library for NestJS

License

Notifications You must be signed in to change notification settings

beincom/zanc

Repository files navigation

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.

About

Application states management library for NestJS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published