A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.
This is a Consul module for Nest.
$ npm i --save nest-bootstrap
import { Module } from '@nestjs/common';
import { BootstrapModule } from 'nest-bootstrap';
@Module({
imports: [BootstrapModule.forRoot(__dirname, env => `bootstrap-${env}.yml`)],
})
export class ApplicationModule {}
web:
port: 3000
import { Component } from '@nestjs/common';
import { InjectBootstrap, Bootstrap } from 'nest-bootstrap';
@Component()
export class TestService {
constructor(@InjectBootstrap() private readonly bootstrap: Bootstrap) {}
getPort() {
return this.bootstrap.get('web.port', 3000);
}
}
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Miaowing
- Website - https://nestjs.com
Nest is MIT licensed.