npm additions, code fixes and env variables added

This commit is contained in:
piratefinn 2017-07-27 17:07:41 +01:00
parent 51097bc09f
commit 620282e9ac
6 changed files with 7320 additions and 77 deletions

View file

@ -26,7 +26,8 @@
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
"prod": "environments/environment.prod.ts",
"local": "environments/environment.local.ts"
}
}
],

7246
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,13 +1,14 @@
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { Observable } from 'rxjs/Rx';
import { environment } from '../../environments/environment';
import 'rxjs/add/operator/map';
/* this provider handles the interaction between server and client */
@Injectable()
export class ApiService {
private apiUrl = 'https://dev.peartrade.org/api';
private apiUrl = environment.apiUrl;
private sessionKey: string = null;
constructor(
private http: Http,
@ -130,14 +131,12 @@ export class ApiService {
},
},
"data" :
"graphs" :
{
"customersthisweek" :
{
day : ['Monday', 'tuesday','wednesday','thursday','friday','saturday','sunday'],
customerno : [1,2,3,4,5,6,7],
returningcustomerno : [1,1,2,3,4,5,4],
totalcustomerno:
},
"customerslastweek" :
{
@ -183,20 +182,6 @@ export class ApiService {
percentsinglecompetitorlocal : 65,
},
},
"snippets" :
{
"customersinsector" :
{
percent : 76,
customerno : 34000,
},
"localsuppliers" :
{
percentownlocal : 50,
percentsinglecompetitorlocal : 65,
},
},
}
)
}

View file

@ -0,0 +1,9 @@
// The file contents for the current environment will overwrite these during build.
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `angular-cli.json`.
export const environment = {
production: false,
apiUrl: 'http://192.168.2.156:3000/api'
};

View file

@ -1,3 +1,4 @@
export const environment = {
production: true
production: true,
apiUrl: 'http://app.peartrade.org/api'
};

View file

@ -4,5 +4,6 @@
// The list of which env maps to which file can be found in `angular-cli.json`.
export const environment = {
production: false
production: false,
apiUrl: 'http://dev.peartrade.org/api'
};