From f79674d3c20d2ac5d19d2c7e4895601257cad4dc Mon Sep 17 00:00:00 2001 From: Ales Zima Date: Wed, 12 Jun 2024 15:25:32 +0200 Subject: [PATCH] Testing with absolute path to api --- .github/workflows/deploy.yml | 2 -- src/pages/country/[code].astro | 4 +++- src/pages/index.astro | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3edc378..77090f0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/src/pages/country/[code].astro b/src/pages/country/[code].astro index 6c9c7f9..fb99f4d 100644 --- a/src/pages/country/[code].astro +++ b/src/pages/country/[code].astro @@ -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'); diff --git a/src/pages/index.astro b/src/pages/index.astro index b02739e..53466c9 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -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');