diff --git a/.gitignore b/.gitignore index 0711527..839e43a 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,6 @@ testem.log # System files .DS_Store Thumbs.db + +# api-key +env.ts \ No newline at end of file diff --git a/src/app/open-horoscope/open-horoscope.service.ts b/src/app/open-horoscope/open-horoscope.service.ts index 6492d84..d44886e 100644 --- a/src/app/open-horoscope/open-horoscope.service.ts +++ b/src/app/open-horoscope/open-horoscope.service.ts @@ -3,6 +3,7 @@ import { HttpClient, HttpErrorResponse, HttpHeaders, HttpParams } from '@angular import { Observable, catchError, throwError } from 'rxjs'; import { HoroscopeData } from '../models/horoscope.model'; import * as alertifyjs from 'alertifyjs'; +import { env } from 'env'; @Injectable({ providedIn: 'root' @@ -15,7 +16,8 @@ export class OpenHoroscopeService { const url = 'https://horoscope-astrology.p.rapidapi.com/sign?'; const headers = new HttpHeaders({ - 'X-RapidAPI-Key': '5016ac0ebdmsha06ee5d995fe2c4p108e0fjsn03c8c4f21287', + //'X-RapidAPI-Key': '5016ac0ebdmsha06ee5d995fe2c4p108e0fjsn03c8c4f21287', + 'X-RapidAPI-Key': env.API_KEY, 'X-RapidAPI-Host': 'horoscope-astrology.p.rapidapi.com' }); const params = new HttpParams() diff --git a/src/app/open-numerology/open-numerology.service.ts b/src/app/open-numerology/open-numerology.service.ts index ab957a7..5aa31ba 100644 --- a/src/app/open-numerology/open-numerology.service.ts +++ b/src/app/open-numerology/open-numerology.service.ts @@ -4,6 +4,8 @@ import { NumerologyData } from '../models/numerology.model'; import { Observable } from 'rxjs/internal/Observable'; import { catchError, throwError } from 'rxjs'; import * as alertifyjs from 'alertifyjs'; +import { DefinePlugin, webpack } from 'webpack'; +import { env } from 'env'; @Injectable({ providedIn: 'root' @@ -16,7 +18,7 @@ export class OpenNumerologyService { const url = 'https://horoscope-astrology.p.rapidapi.com/numerology?'; const headers = new HttpHeaders({ - 'X-RapidAPI-Key': '5016ac0ebdmsha06ee5d995fe2c4p108e0fjsn03c8c4f21287', + 'X-RapidAPI-Key': env.API_KEY, 'X-RapidAPI-Host': 'horoscope-astrology.p.rapidapi.com' }); const params = new HttpParams() diff --git a/tsconfig.app.json b/tsconfig.app.json index 374cc9d..9161a71 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -3,7 +3,7 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", - "types": [] + "types": ["node"] }, "files": [ "src/main.ts"