@godigit/nestjs-master-lib

1.0.13 • Public • Published

NestJS npm Package Starter

Installation

  1. Run npm/yarn install
npm install --save @godigit/nestjs-master-lib
  1. Setting config in parent module controller
import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
import {MasterLibService} from "@godigit/nestjs-master-lib/dist/master-lib/master-lib.service";
import {MasterLibConfig} from "@godigit/nestjs-master-lib/dist/master-lib/interface/master-lib-config.interface";
import * as path from "path";
import {ConfigService} from "./services/config/config.service";

@Controller()
export class AppController {
    //import master-lib service 'private masterLib: MasterLibService'
  constructor(private readonly appService: AppService, private masterLib: MasterLibService, private config : ConfigService) {
    //setting master-lib config using MasterLibConfig interface
    const configApiPath = path.join(__dirname,"configs","api-config")
    const configFormPath = path.join(__dirname,"configs","form-config")
    const masterLibConfig: MasterLibConfig = {
      config: config,
      formPathConfig: configFormPath,
      apiPathConfig: configApiPath
    }
    this.masterLib.setConfig(masterLibConfig)
  }

  @Get()
  getHello(): string {
    return this.appService.getHello();
  }
}

Change Log

See Changelog for more information.

Contributing

Contributions welcome! See Contributing.

Author

Godigit Public Library (Y Prospect on Discord)

License

Licensed under the MIT License - see the LICENSE file for details.

Readme

Keywords

Package Sidebar

Install

npm i @godigit/nestjs-master-lib

Weekly Downloads

20

Version

1.0.13

License

MIT

Unpacked Size

27.8 kB

Total Files

31

Last publish

Collaborators

  • pai.thanapat
  • soghband
  • koftkoft
  • k2ex