Skip to content

Commit

Permalink
fix api endpoints over env
Browse files Browse the repository at this point in the history
  • Loading branch information
klandeck committed Apr 6, 2022
1 parent d527064 commit 615b358
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions deployment-sample/mifune-local/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ services:
- "../../server/server/src/test/resources/samples/bom/:/model/:z"
environment:
QUARKUS_PROFILE: "local"
MIFUNE_ROOT_PATH_API: "http://localhost:8080/api/"
MIFUNE_ROOT_PATH_UI: "http://localhost:8080/ui/"
MIFUNE_ROOT_PATH_API: "http://localhost:8080"
MIFUNE_ROOT_PATH_UI: "http://localhost:8080"
QUARKUS_NEO4J_URI: "bolt://neo4j:7687"
3 changes: 2 additions & 1 deletion ui/src/env/Environments.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export enum ENV {
API_SERVER = 'API_SERVER',
BASE_PATH = 'BASE_PATH',
ROOT_URL = 'ROOT_URL',
LOGIN_REQUIRED = 'LOGIN_REQUIRED',
}
6 changes: 3 additions & 3 deletions ui/src/helpers/EventSourceHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const header = (): Record<string, unknown> => {

export const cleanDatabase = (): EventSourcePolyfill => {
return new EventSourcePolyfill(
`${localStorage.getItem(ENV.API_SERVER)}apocalypse`,
`${localStorage.getItem(ENV.API_SERVER)}/api/apocalypse`,
{
headers: header(),
heartbeatTimeout: 2000,
Expand All @@ -24,7 +24,7 @@ export const cleanDatabase = (): EventSourcePolyfill => {

export const importSource = (): EventSourcePolyfill => {
return new EventSourcePolyfill(
`${localStorage.getItem(ENV.API_SERVER)}graph/domain/fn/statistics`,
`${localStorage.getItem(ENV.API_SERVER)}/api/graph/domain/fn/statistics`,
{
headers: header(),
heartbeatTimeout: 15000,
Expand All @@ -34,7 +34,7 @@ export const importSource = (): EventSourcePolyfill => {

export const graphStats = (): EventSourcePolyfill => {
return new EventSourcePolyfill(
`${localStorage.getItem(ENV.API_SERVER)}graph/stats`,
`${localStorage.getItem(ENV.API_SERVER)}/api/graph/stats`,
{
headers: header(),
heartbeatTimeout: 2000,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/openapi/axios-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ENV } from '../env/Environments'
import { Configuration } from '../services'

const AXIOS_CONFIG = (): Configuration => {
const basePath = 'http://localhost:8080'
const basePath = localStorage.getItem(ENV.API_SERVER) ?? undefined
const apiKey = undefined
const username = undefined
const password = undefined
Expand Down

0 comments on commit 615b358

Please sign in to comment.