Skip to content

Commit

Permalink
Testing with absolute path to api
Browse files Browse the repository at this point in the history
  • Loading branch information
Ales Zima committed Jun 12, 2024
1 parent c0ca77e commit f79674d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ permissions:

jobs:
build:
env:
PUBLIC_API_BASE_URL: ${{ secrets.PUBLIC_API_BASE_URL }}
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
Expand Down
4 changes: 3 additions & 1 deletion src/pages/country/[code].astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export const getStaticPaths = async () => {
}
async function fetchCountryData() {
const url = new URL(`${import.meta.env.PUBLIC_API_BASE_URL}/country.json`);
const url = new URL(
'https://esosek.github.io/rest-countries/api/country.json'
);
const response = await fetch(url);
if (!response.ok) {
throw new Error('Failed to fetch country data');
Expand Down
4 changes: 3 additions & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import Homepage from '../components/homepage/Homepage';
import type { Country } from '../types/country';
async function fetchCountryData() {
const url = new URL(`${import.meta.env.API_BASE_URL}/country.json`);
const url = new URL(
'https://esosek.github.io/rest-countries/api/country.json'
);
const response = await fetch(url);
if (!response.ok) {
throw new Error('Failed to fetch country data');
Expand Down

0 comments on commit f79674d

Please sign in to comment.