diff --git a/.env.example b/.env.example index b755c95..45851ae 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,3 @@ VUE_APP_TITLE="Dev - Popover Search Ionic" -VUE_APP_API_URL="https://api.api-ninjas.com/v1" \ No newline at end of file +VUE_APP_API_URL="https://api.api-ninjas.com/v1" +VUE_APP_PUBLIC_PATH="/" \ No newline at end of file diff --git a/.env.production b/.env.production index 4dfad60..03de4cc 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,3 @@ VUE_APP_TITLE="Popover Search Ionic" -VUE_APP_API_URL="https://api.api-ninjas.com/v1" \ No newline at end of file +VUE_APP_API_URL="https://api.api-ninjas.com/v1" +VUE_APP_PUBLIC_PATH="/popover-search-ionic/" \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 7f9d0ff..1272620 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -9,7 +9,7 @@ const routes = [ ]; const router = createRouter({ - history: createWebHistory(process.env.BASE_URL), + history: createWebHistory(process.env.VUE_APP_PUBLIC_PATH), routes, }); diff --git a/vue.config.js b/vue.config.js index 99aa308..510d12c 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,7 +1,7 @@ const path = require("path"); module.exports = { - publicPath: "./", + publicPath: process.env.VUE_APP_PUBLIC_PATH || "/", devServer: { port: process.env.VUE_APP_PORT || "8080", },