@godigit/nestjs-master-lib
v1.0.13
Published
nest master lib
Downloads
22
Keywords
Readme
Installation
- Run npm/yarn install
npm install --save @godigit/nestjs-master-lib
- 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.