From 8bdfbfc0ebea961fe51940d345c23a57c83b88f1 Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Fri, 17 Jan 2020 15:59:39 +0100 Subject: [PATCH 1/3] Throw error when API_URI is not set --- webpack.config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index a61e7595c..ad8a00efb 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -35,6 +35,10 @@ module.exports = (env, argv) => { let fileLoaderPath; let output; + if(!process.env.API_URI) { + throw new Error("Environment variable API_URI not set") + } + if (!devMode) { const publicPath = process.env.STATIC_URL || "/"; output = { From fdd988d1dbcae5040c4ed0499436cef3f794e3a0 Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Fri, 17 Jan 2020 16:00:35 +0100 Subject: [PATCH 2/3] Remove default value because it's unused --- src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index 11254d693..283db79a2 100644 --- a/src/config.ts +++ b/src/config.ts @@ -3,7 +3,7 @@ import { SearchVariables } from "./hooks/makeSearch"; import { ListSettings, ListViews } from "./types"; export const APP_MOUNT_URI = process.env.APP_MOUNT_URI || "/"; -export const API_URI = process.env.API_URI || "/graphql/"; +export const API_URI = process.env.API_URI; export const DEFAULT_INITIAL_SEARCH_DATA: SearchVariables = { after: null, From 052bc7f752f6fcca4b8fe525501152e4941422e2 Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Fri, 17 Jan 2020 16:01:30 +0100 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc71971e6..c8b8045c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ All notable, unreleased changes to this project will be documented in this file. - Add table sorting - #292 by @dominik-zeglen - Unify dialog handling - #296 by @dominik-zeglen - Stop using deprecated fields - #357 by @dominik-zeglen +- Throw error when API_URI is not set - #375 by @dominik-zeglen ## 2.0.0