Skip to content

Commit

Permalink
Update api endpoint and create env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Bartosik committed Sep 22, 2021
1 parent 932437a commit f09a607
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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
4 changes: 3 additions & 1 deletion src/helpers/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import axios from 'axios';
import Country from 'models/Country';

const baseUrl = 'https://restcountries.eu/rest/v2/all';
const { REACT_APP_ACCESS_KEY } = process.env;

const baseUrl = `https://api.countrylayer.com/v2/all?access_key=${REACT_APP_ACCESS_KEY}`;

export const getCountries = async () => {
const { data }: { data: Country[] } = await axios.get(baseUrl);
Expand Down

1 comment on commit f09a607

@vercel
Copy link

@vercel vercel bot commented on f09a607 Sep 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.