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 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, 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 = {