basic env.js file for api baseurl, documentserver_key

ref #3
This commit is contained in:
Philipp Dormann 2021-03-03 18:20:53 +01:00
parent faf19d9e43
commit 747c1d2a90
4 changed files with 10 additions and 2 deletions

3
.gitignore vendored
View File

@ -182,4 +182,5 @@ docs/_book
test/
/package-lock.json
/yarn.lock
/yarn.lock
/public/env.js

View File

@ -10,6 +10,7 @@
<body class="dark:bg-gray-900 text-black dark:text-white p-0">
<div id="app"></div>
<script src="/env.js"></script>
<script type="module" src="/src/main.js"></script>
</body>

6
public/env.sample.js Normal file
View File

@ -0,0 +1,6 @@
const config = {
documentserver_key: '',
baseurl: '',
url_imprint: '',
url_privacy: ''
};

View File

@ -254,7 +254,7 @@ function login() {
}
}
toast("registration in progress...");
axios.post('https://dev.lauf-fuer-kaya.de/api/runners/register', postdata)
axios.post(`${config.baseurl}api/runners/register`, postdata)
.then((response) => {
response = response.data;
const token = response.token;