added env with api key

This commit is contained in:
s473561 2023-07-05 19:11:08 +02:00
parent 1249502085
commit 8b509cc83b
4 changed files with 10 additions and 3 deletions

3
.gitignore vendored
View File

@ -40,3 +40,6 @@ testem.log
# System files
.DS_Store
Thumbs.db
# api-key
env.ts

View File

@ -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()

View File

@ -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()

View File

@ -3,7 +3,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
"types": ["node"]
},
"files": [
"src/main.ts"