Adding app config module
This commit is contained in:
2
api/.gitignore
vendored
2
api/.gitignore
vendored
@@ -54,3 +54,5 @@ pids
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
local.settings.json
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"IsEncrypted": false,
|
||||
"Values": {
|
||||
"AzureWebJobsStorage": "",
|
||||
"FUNCTIONS_WORKER_RUNTIME": "node"
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@
|
||||
"@nestjs/common": "^10.0.0",
|
||||
"@nestjs/core": "^10.0.0",
|
||||
"@nestjs/platform-express": "^10.0.0",
|
||||
"@noahspan/noahspan-modules": "^0.0.1",
|
||||
"@schematics/angular": "^17.3.7",
|
||||
"dotenv": "^16.4.5",
|
||||
"reflect-metadata": "0.1.13",
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { AppService } from './app.service';
|
||||
import { AzAppConfigService } from '@noahspan/noahspan-modules';
|
||||
|
||||
@Controller()
|
||||
export class AppController {
|
||||
constructor(private readonly appService: AppService) {}
|
||||
constructor(private readonly azAppConfigService: AzAppConfigService) {}
|
||||
|
||||
@Get()
|
||||
getHello(): string {
|
||||
return this.appService.getHello();
|
||||
@Get('featureFlag')
|
||||
getFeatureFlag(key: string, label: string): string {
|
||||
const featureFlag = this.azAppConfigService.getFeatureFlag(key, label);
|
||||
console.log(process.env.AZ_APP_CONFIG_CONNECTION_STRING);
|
||||
return 'blah';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
import { AzAppConfigModule } from '@noahspan/noahspan-modules';
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
imports: [
|
||||
AzAppConfigModule.register({
|
||||
connectionString: process.env.AZ_APP_CONFIG_CONNECTION_STRING
|
||||
})
|
||||
],
|
||||
controllers: [AppController],
|
||||
providers: [AppService]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user