Skip to content

Commit

Permalink
Provided typing for environment.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
emonney committed Oct 26, 2024
1 parent 24495d2 commit 059b5a4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions quickapp.client/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
"budgets": [
{
"type": "initial",
"maximumWarning": "1mb",
"maximumError": "2mb"
"maximumWarning": "2mb",
"maximumError": "4mb"
},
{
"type": "anyComponentStyle",
Expand Down
11 changes: 11 additions & 0 deletions quickapp.client/src/app/models/environment.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// ---------------------------------------
// Email: [email protected]
// Templates: www.ebenmonney.com/templates
// (c) 2024 www.ebenmonney.com/mit-license
// ---------------------------------------

export interface Environment {
production: boolean;
baseUrl?: string | null;
fallbackBaseUrl?: string | null;
}
4 changes: 3 additions & 1 deletion quickapp.client/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
// (c) 2024 www.ebenmonney.com/mit-license
// ---------------------------------------

export const environment = {
import { Environment } from "../app/models/environment.model";

export const environment: Environment = {
production: true,
baseUrl: null, // Set to null to use the current host (i.e if the client app and server api are hosted together)
};
4 changes: 3 additions & 1 deletion quickapp.client/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
// (c) 2024 www.ebenmonney.com/mit-license
// ---------------------------------------

import { Environment } from "../app/models/environment.model";

// This file can be replaced during build by using the `fileReplacements` array.
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.

export const environment = {
export const environment: Environment = {
production: false,
baseUrl: 'https://localhost:7085', // API Server url
fallbackBaseUrl: 'https://quickapp.azurewebsites.net', // Fallback API Server for development without local API server
Expand Down

0 comments on commit 059b5a4

Please sign in to comment.