Skip to content

Commit

Permalink
Removed News API key
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapil Raghuwanshi committed Jun 7, 2020
1 parent 712a701 commit b7b3688
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ google-services.json
GoogleService-Info.plist
coronatracker-20efc-firebase-adminsdk-6bpw9-23ce9cc25d.json
coronatracker-273014-e9a0c6eb53fd.json
src/newsApikey.ts
3 changes: 2 additions & 1 deletion src/pages/NewsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { IonContent, IonHeader, IonPage, IonToolbar, IonRow, IonCol, IonImg, Ion
import moment from 'moment';
import axios from 'axios';
import './NewsTab.css';
import NEWS_API_KEY from '../newsApikey';

interface INewsResponse {
status: string;
Expand Down Expand Up @@ -32,7 +33,7 @@ const NewsTab: React.FC = () => {

useEffect(() => {
const getNewsData = async () => {
const result = await axios('https://newsapi.org/v2/top-headlines?q=coronavirus&language=en&apiKey=YOUR_OWN_KEY');
const result = await axios('https://newsapi.org/v2/top-headlines?q=coronavirus&language=en&apiKey=' + NEWS_API_KEY);
// console.log(result);
setData(result.data.articles);
setShowLoading(false);
Expand Down

0 comments on commit b7b3688

Please sign in to comment.