Skip to content

Commit

Permalink
refactor: move coins api url to .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
WFZ1 committed Aug 18, 2024
1 parent 3d5ae73 commit 7ba7773
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
env:
NEWS_API_URL: ${{ vars.NEWS_API_URL }}
NEWS_API_KEY: ${{ vars.NEWS_API_KEY }}
COINS_API_URL: ${{ vars.COINS_API_URL }}

jobs:
build-and-deploy:
Expand Down
2 changes: 1 addition & 1 deletion app/src/pages/сurrency.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const CurrencyPage = ({ serverData }: CurrencyPageProps) => {
export const getServerData = async () => {
try {
const response = await fetch(
`https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=10&page=1&sparkline=false`
`${process.env.COINS_API_URL}/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=10&page=1&sparkline=false`
);

if (!response.ok) {
Expand Down

0 comments on commit 7ba7773

Please sign in to comment.