Add test environment variables

This commit is contained in:
2023-01-06 18:36:24 +01:00
parent acc2c67688
commit 8999405dca
7 changed files with 18 additions and 4 deletions

View File

@@ -12,7 +12,7 @@
<button mat-icon-button (click)="snav.toggle()"> <button mat-icon-button (click)="snav.toggle()">
<mat-icon>menu</mat-icon> <mat-icon>menu</mat-icon>
</button> </button>
<h1 class="topbar-app-name">DiunaBI</h1> <h1 class="topbar-app-name">DiunaBI {{environment.appTitle}}</h1>
<span class="fill-to-right"></span> <span class="fill-to-right"></span>
<span class="topbar-user-name" *ngIf="auth$.user"> <span class="topbar-user-name" *ngIf="auth$.user">
<img *ngIf="auth$.user.avatar" src="{{auth$.user.avatar}}" class="avatar"> <img *ngIf="auth$.user.avatar" src="{{auth$.user.avatar}}" class="avatar">

View File

@@ -5,6 +5,7 @@ import { SwUpdate } from '@angular/service-worker';
import * as moment from 'moment'; import * as moment from 'moment';
import packageInfo from 'package.json'; import packageInfo from 'package.json';
import { delay } from 'rxjs'; import { delay } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AuthService } from '../auth/auth.service'; import { AuthService } from '../auth/auth.service';
import { DataService } from '../services/data.service'; import { DataService } from '../services/data.service';
import { DeviceService } from '../services/device.service'; import { DeviceService } from '../services/device.service';
@@ -21,6 +22,7 @@ export class MainViewComponent {
currentDate = moment().toDate(); currentDate = moment().toDate();
flipPhone = false; flipPhone = false;
loading = false; loading = false;
environment = environment;
constructor( constructor(
public data$: DataService, public data$: DataService,

View File

@@ -1,4 +1,5 @@
export const environment = { export const environment = {
appTitle: "#{appTitle}#",
production: true, production: true,
api: { api: {
url: "https://diunabi.bim-it.pl/api" url: "https://diunabi.bim-it.pl/api"

View File

@@ -3,10 +3,11 @@
// The list of file replacements can be found in `angular.json`. // The list of file replacements can be found in `angular.json`.
export const environment = { export const environment = {
appTitle: "DEV",
production: false, production: false,
api: { api: {
url: "http://localhost:5400/api" //url: "http://localhost:5400/api"
//url: "https://diunabi.bim-it.pl/api" url: "https://diunabi.bim-it.pl/api"
}, },
google: { google: {
clientId: "107631825312-bkfe438ehr9k9ecb2h76g802tj6advma.apps.googleusercontent.com" clientId: "107631825312-bkfe438ehr9k9ecb2h76g802tj6advma.apps.googleusercontent.com"

View File

@@ -18,11 +18,19 @@ namespace WebAPI.Controllers
[Authorize] [Authorize]
public class PingController : Controller public class PingController : Controller
{ {
private readonly IConfiguration configuration;
public PingController(
IConfiguration _configuration)
{
configuration = _configuration;
}
[HttpGet] [HttpGet]
[Route("Ping")] [Route("Ping")]
[AllowAnonymous]
public IActionResult Ping() public IActionResult Ping()
{ {
return Ok(new { data = "Pong" }); return Ok(configuration["PONG"]);
} }
} }
} }

View File

@@ -1,4 +1,5 @@
{ {
"PONG": "Development",
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Information", "Default": "Information",

View File

@@ -1,4 +1,5 @@
{ {
"PONG": "#{PING}#",
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Information", "Default": "Information",