Skip to content

Commit

Permalink
Add support for environment feature
Browse files Browse the repository at this point in the history
  • Loading branch information
fleboulch committed Oct 2, 2018
1 parent 4cc32fc commit cbdbcc2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API_BASE_URL=http://localhost:8080/api
1 change: 1 addition & 0 deletions .env.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API_BASE_URL=http://my-prod-domain/api
2 changes: 1 addition & 1 deletion ionic.starter.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "JHipster Starter",
"baseref": "504dfeec2df39683cdb1500d34853582ca9b8df7",
"baseref": "master",
"welcome": "Welcome to the \u001b[34m\u001b[1mIonic\u001b[22m\u001b[39m \u001b[32m\u001b[1mJ\u001b[22m\u001b[39m\u001b[31m\u001b[1mHipster\u001b[22m\u001b[39m Starter!\n\nThe Ionic JHipster Starter ships with login and signup that will work with a JHipster backend (with JWT Authentication). \n\nFor more details, please see the project's README: \u001b[1mhttps://github.com/oktadeveloper/ionic-jhipster-starter/blob/master/README.md\u001b[22m",
"packageJson": {
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/declarations.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare var process: { env: { [key: string]: string | undefined; } };
2 changes: 1 addition & 1 deletion src/providers/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Injectable } from '@angular/core';
*/
@Injectable()
export class Api {
public static API_URL: string = 'http://localhost:8080/api';
public static API_URL: string = process.env.API_BASE_URL;

constructor(public http: HttpClient) {
}
Expand Down
3 changes: 2 additions & 1 deletion src/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"outDir": "../out-tsc/spec",
"module": "commonjs",
"target": "es5",
"allowJs": true
"allowJs": true,
"types": []
},
"include": [
"**/*.spec.ts"
Expand Down

0 comments on commit cbdbcc2

Please sign in to comment.