From ad4635339edd47ecd39c3e15da50e2d7aa04caa0 Mon Sep 17 00:00:00 2001 From: Steve Springett Date: Wed, 1 Jan 2020 01:19:55 -0600 Subject: [PATCH] Experimenting with production API base urls --- public/index.jsp | 18 ------------------ src/shared/api.js | 13 +------------ vue.config.js | 3 ++- 3 files changed, 3 insertions(+), 31 deletions(-) delete mode 100644 public/index.jsp diff --git a/public/index.jsp b/public/index.jsp deleted file mode 100644 index d666ea007..000000000 --- a/public/index.jsp +++ /dev/null @@ -1,18 +0,0 @@ -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - - - /"> - - - Dependency-Track - - - -
- - diff --git a/src/shared/api.js b/src/shared/api.js index a31960cb8..b0d123d39 100644 --- a/src/shared/api.js +++ b/src/shared/api.js @@ -4,18 +4,7 @@ * avoid typographical errors. */ -//const BASE_URL = process.env.NODE_ENV === "production" ? process.env.VUE_APP_SERVER_URL : ""; - -let contextPath = function contextPath() { - if (process.env.NODE_ENV === "production") { - let path = document.head.querySelector("[name=context-path]").content; - return (path.substr(-1) === '/') ? path : path + "/"; - } else { - return ""; - } -}; - -const BASE_URL = contextPath(); +const BASE_URL = ""; // API Behavior const CONTENT_TYPE_JSON = "application/json"; diff --git a/vue.config.js b/vue.config.js index 554f4940f..c9e7860be 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,7 +1,8 @@ module.exports = { lintOnSave: false, runtimeCompiler: true, - publicPath: "/", + //publicPath: "/", + publicPath: process.env.NODE_ENV === 'production' ? '.' : '/', devServer: { proxy: { "/api": { target: process.env.VUE_APP_SERVER_URL } } }