From f2f99ac88111c3f260f947900ee574e2f7e966d4 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Wed, 28 Jul 2021 21:52:12 +0200 Subject: [PATCH] provide config.js --- .gitignore | 2 ++ README.md | 18 ++++++++++++------ public/config.js.dev | 3 +++ public/index.html | 4 ++++ src/App.vue | 2 +- src/components/AutoComplete.vue | 6 +++--- src/components/ProfileList.vue | 4 ++-- src/main.js | 8 ++------ src/views/Search.vue | 4 ++-- src/views/profile/Edit.vue | 8 ++++---- src/views/profile/View.vue | 4 ++-- 11 files changed, 37 insertions(+), 26 deletions(-) create mode 100644 public/config.js.dev diff --git a/.gitignore b/.gitignore index 403adbc..5c0d718 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ node_modules /dist +# KI +/public/config.js # local env files .env.local diff --git a/README.md b/README.md index dd83ea2..bdceaae 100644 --- a/README.md +++ b/README.md @@ -3,19 +3,28 @@ [![Build Status](https://drone.wtf-eg.de/api/badges/kompetenzinventar/ki-frontend/status.svg)](https://drone.wtf-eg.de/kompetenzinventar/ki-frontend) Vue3 Projekt: + ## Project setup ``` npm ci ``` +### Konfigurationsdatei anpassen + +``` +cp public/config.js.dev public/config.js +vi public/config.js +``` + + ### Compiles and hot-reloads for development ``` -VUE_APP_API_URL=http://localhost:8000 npm run serve +npm run serve ``` ### Compiles and minifies for production ``` -VUE_APP_API_URL=http://localhost:8000 npm run build +npm run build ``` ### Lints and fixes files @@ -28,9 +37,6 @@ See [Configuration Reference](https://cli.vuejs.org/config/). Vorraussetzung: Node & NPM -### Enviroment Variable -VUE_APP_API_URL ist die Enviroment Variable mit der die Adresse der API übergeben wird - ## Docker @@ -46,7 +52,7 @@ docker build --target ki-frontend --tag ki_frontend . ``` docker run \ --name=ki_frontend \ - -e VUE_APP_API_URL=http://localhost:5000 \ + -v ${PWD}/public/config.js:/user/share/nginx/html/config.js \ -p 8000:80 \ ki_frontend ``` diff --git a/public/config.js.dev b/public/config.js.dev new file mode 100644 index 0000000..c696cc7 --- /dev/null +++ b/public/config.js.dev @@ -0,0 +1,3 @@ +window.ki = { + apiUrl: 'http://localhost:5000' +} diff --git a/public/index.html b/public/index.html index d35b8d0..a1a0341 100644 --- a/public/index.html +++ b/public/index.html @@ -4,9 +4,13 @@ + + Kompetenz Inventar der WTF eG + +