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()">
<mat-icon>menu</mat-icon>
</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="topbar-user-name" *ngIf="auth$.user">
<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 packageInfo from 'package.json';
import { delay } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AuthService } from '../auth/auth.service';
import { DataService } from '../services/data.service';
import { DeviceService } from '../services/device.service';
@@ -21,6 +22,7 @@ export class MainViewComponent {
currentDate = moment().toDate();
flipPhone = false;
loading = false;
environment = environment;
constructor(
public data$: DataService,

View File

@@ -1,4 +1,5 @@
export const environment = {
appTitle: "#{appTitle}#",
production: true,
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`.
export const environment = {
appTitle: "DEV",
production: false,
api: {
url: "http://localhost:5400/api"
//url: "https://diunabi.bim-it.pl/api"
//url: "http://localhost:5400/api"
url: "https://diunabi.bim-it.pl/api"
},
google: {
clientId: "107631825312-bkfe438ehr9k9ecb2h76g802tj6advma.apps.googleusercontent.com"

View File

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

View File

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

View File

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