frontend: Add API url config

This commit is contained in:
Paul Bienkowski 2021-02-28 22:21:38 +01:00
parent e10b29e0c6
commit a0d9c2dbc4
3 changed files with 3 additions and 1 deletions

View file

@ -172,7 +172,7 @@ class API {
async fetch(url, options = {}) { async fetch(url, options = {}) {
const accessToken = await this.getValidAccessToken() const accessToken = await this.getValidAccessToken()
const response = await window.fetch('/api' + url, { const response = await window.fetch(config.apiUrl + '/api' + url, {
...options, ...options,
headers: { headers: {
...(options.headers || {}), ...(options.headers || {}),

View file

@ -1,4 +1,5 @@
{ {
"apiUrl": "http://localhost:3001",
"auth": { "auth": {
"server": "http://localhost:3000", "server": "http://localhost:3000",
"clientId": "b730f8d2-d93c-4c68-9ff0-dfac8da76ee2", "clientId": "b730f8d2-d93c-4c68-9ff0-dfac8da76ee2",

View file

@ -1,4 +1,5 @@
{ {
"apiUrl": "https://api.example.com",
"auth": { "auth": {
"server": "https://api.example.com", "server": "https://api.example.com",
"clientId": "CHANGEME", "clientId": "CHANGEME",