Features/15 add azure app configuration #16

Merged
noahspannbauer merged 3 commits from features/15-add-azure-app-configuration into main 2024-05-28 13:35:34 -04:00
8 changed files with 142 additions and 16 deletions
Showing only changes of commit 80a86a281c - Show all commits

BIN
.DS_Store vendored

Binary file not shown.

2
api/.gitignore vendored
View File

@@ -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

View File

@@ -1,7 +0,0 @@
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"FUNCTIONS_WORKER_RUNTIME": "node"
}
}

View File

@@ -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",

View File

@@ -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';
}
}

View File

@@ -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]
})

123
package-lock.json generated
View File

@@ -9,9 +9,12 @@
"version": "1.0.0",
"workspaces": [
"api",
"client",
"app",
"tests"
],
"dependencies": {
"@azure/app-configuration": "^1.6.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
@@ -34,6 +37,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",
@@ -57,9 +61,36 @@
"typescript": "^5.1.3"
}
},
"app": {
"name": "@noahspan/flying-client",
"version": "0.1.0",
"dependencies": {
"@azure/msal-react": "^2.0.15",
"@nextui-org/react": "^2.3.6",
"framer-motion": "^11.1.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.51.4",
"react-router-dom": "^6.23.0"
},
"devDependencies": {
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"typescript": "^5.2.2",
"vite": "^5.2.0"
},
"engines": {
"node": ">=18.0.0"
}
},
"client": {
"name": "@noahspan/flying-client",
"version": "0.1.0",
"extraneous": true,
"dependencies": {
"@azure/msal-react": "^2.0.15",
"@nextui-org/react": "^2.3.6",
@@ -299,6 +330,27 @@
"node": ">=12.0.0"
}
},
"node_modules/@azure/app-configuration": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/@azure/app-configuration/-/app-configuration-1.6.0.tgz",
"integrity": "sha512-5Ae4SB0g4VbTnF7B+bwlkRLesRIYcaeg6e2Qxf0RlOEIetIgfAZiX6S5e7hD83X5RkwiPmzDm8rJm6HDpnVcvQ==",
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-client": "^1.5.0",
"@azure/core-http-compat": "^2.0.0",
"@azure/core-lro": "^2.5.1",
"@azure/core-paging": "^1.4.0",
"@azure/core-rest-pipeline": "^1.6.0",
"@azure/core-tracing": "^1.0.0",
"@azure/core-util": "^1.6.1",
"@azure/logger": "^1.0.0",
"tslib": "^2.2.0"
},
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/@azure/core-auth": {
"version": "1.7.2",
"resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.7.2.tgz",
@@ -351,6 +403,55 @@
"node": ">=18.0.0"
}
},
"node_modules/@azure/core-http-compat": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-2.1.2.tgz",
"integrity": "sha512-5MnV1yqzZwgNLLjlizsU3QqOeQChkIXw781Fwh1xdAqJR5AA32IUaq6xv1BICJvfbHoa+JYcaij2HFkhLbNTJQ==",
"dependencies": {
"@azure/abort-controller": "^2.0.0",
"@azure/core-client": "^1.3.0",
"@azure/core-rest-pipeline": "^1.3.0"
},
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/@azure/core-http-compat/node_modules/@azure/abort-controller": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz",
"integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==",
"dependencies": {
"tslib": "^2.6.2"
},
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/@azure/core-lro": {
"version": "2.7.2",
"resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.7.2.tgz",
"integrity": "sha512-0YIpccoX8m/k00O7mDDMdJpbr6mf1yWo2dfmxt5A8XVZVVMz2SSKaEbMCeJRvgQ0IaSlqhjT47p4hVIRRy90xw==",
"dependencies": {
"@azure/abort-controller": "^2.0.0",
"@azure/core-util": "^1.2.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.6.2"
},
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/@azure/core-lro/node_modules/@azure/abort-controller": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz",
"integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==",
"dependencies": {
"tslib": "^2.6.2"
},
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/@azure/core-paging": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.6.2.tgz",
@@ -4297,9 +4398,27 @@
}
},
"node_modules/@noahspan/flying-client": {
"resolved": "client",
"resolved": "app",
"link": true
},
"node_modules/@noahspan/noahspan-modules": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/@noahspan/noahspan-modules/-/noahspan-modules-0.0.1.tgz",
"integrity": "sha512-VTJg2dGY/6q+6NxtngimxENPrKh/jRDmyR8fAhnZovE7+cgqZ2JjImrZAFqcNPZolheFLwLqM2A4O4oU35MHOQ==",
"dependencies": {
"@azure/app-configuration": "^1.6.0",
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1"
}
},
"node_modules/@noahspan/noahspan-modules/node_modules/reflect-metadata": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz",
"integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q=="
},
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",

View File

@@ -14,15 +14,18 @@
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"eslint": "^8.42.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "3.2.5"
},
"lint-staged": {
"**/*": "prettier --write \"**/src/**/*.ts\" \"**/test/**/*.ts\" --ignore-unknown"
},
"dependencies": {
"@azure/app-configuration": "^1.6.0"
}
}