diff --git a/netlify.toml b/netlify.toml index 7b481163..49559bbf 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,8 @@ command = "yarn build" [build.environment] - REACT_APP_API_SERVER = "https://sakuten-api-dev.herokuapp.com" + REACT_APP_API_SERVER = "https://sakuten-api-testflight.herokuapp.com" + REACT_APP_STAGING_BUILD = "1" [[redirects]] from = "/*" diff --git a/src/api/request.js b/src/api/request.js index 8cf6878a..88adb257 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -2,7 +2,7 @@ import axios from 'axios' import deepAssign from 'deep-assign' import docCookies from 'doc-cookies' -export const apiServer = (process.env.NODE_ENV === 'development' && docCookies.getItem('API_SERVER')) || process.env.REACT_APP_API_SERVER +export const apiServer = ((process.env.NODE_ENV === 'development' || process.env.REACT_APP_STAGING_BUILD) && docCookies.getItem('API_SERVER')) || process.env.REACT_APP_API_SERVER export function fetchApi (endpoint, options) { const opts = deepAssign(options, { baseURL: apiServer,