Skip to content

Commit

Permalink
adding env files to mask secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
vjnvisakh-jtc committed Feb 29, 2024
1 parent ac67fe5 commit aba7f45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
6 changes: 4 additions & 2 deletions src/components/main/main.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export const Main = () => {
const [isSpeaking, setIsSpeaking] = useState(false);

const promotionText = `\n\nDiscover more such quotes at - ${window.location.origin}`;
const NINJA_API_KEY = process.env.REACT_APP_NINJA_API_KEY as string;
const NINJA_URL = process.env.REACT_APP_NINJA_URL as string;

const handleSpeakClick = (text: string) => {

Expand All @@ -44,11 +46,11 @@ export const Main = () => {
setIsLoading(true);

const response = await fetch(
'https://api.api-ninjas.com/v1/quotes',
NINJA_URL,
{
method: 'GET',
headers: {
'X-Api-Key': 'WZl9PgOgZcA+7LYsJTyIkg==SxDi8ufcTDJRpl3i'
'X-Api-Key': NINJA_API_KEY
}
}
);
Expand Down

0 comments on commit aba7f45

Please sign in to comment.