From 949a1957683ffe707c1e6a7ae135e46f1510f1b7 Mon Sep 17 00:00:00 2001 From: Aitor Urrutia Date: Fri, 18 Mar 2022 23:43:31 +0100 Subject: [PATCH] chore: apiurl konpontzen du build-a ongi egiteko --- front/gatsby-config.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/front/gatsby-config.js b/front/gatsby-config.js index e5db431..977e2e3 100644 --- a/front/gatsby-config.js +++ b/front/gatsby-config.js @@ -34,6 +34,8 @@ const query = qs.stringify( }, ); +const apiUrl = process.env.API_URL || 'http://localhost:1337/api'; + module.exports = { plugins: [ 'gatsby-plugin-react-helmet', @@ -48,13 +50,13 @@ module.exports = { resolve: 'gatsby-source-custom-api', options: { rootKey: 'kafetegia', - url: `http://localhost:1337/api/kafetegia?${query}`, + url: `${apiUrl}/kafetegia?${query}`, }, }, { resolve: 'gatsby-source-strapi', options: { - apiURL: process.env.API_URL || 'http://localhost:1337/api', + apiURL: apiUrl, singleTypes: [ 'hasiera', {