Fetch the data correct

This commit is contained in:
dvirlabs 2025-07-03 14:38:38 +03:00
parent 4fc5494525
commit fa26c24d15
5 changed files with 27 additions and 18 deletions

View File

@ -10,7 +10,7 @@ function App() {
const [sections, setSections] = useState([]);
const fetchSections = () => {
fetch('/apps')
fetch('/api/apps')
.then(res => res.json())
.then(data => setSections(data.sections || []));
};

View File

@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: backend
image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag }}"
image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.tag }}"
imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
ports:
- containerPort: 8000

View File

@ -24,7 +24,7 @@ spec:
containers:
- name: frontend
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag }}"
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.tag }}"
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
ports:
- containerPort: 80

View File

@ -10,16 +10,20 @@ metadata:
spec:
ingressClassName: {{ .Values.frontend.ingress.className }}
rules:
- host: {{ .Values.frontend.ingress.hosts[0].host }}
{{- range .Values.frontend.ingress.hosts }}
- host: {{ .host }}
http:
paths:
- path: /
pathType: Prefix
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: navix-frontend
port:
number: {{ .Values.frontend.service.port }}
number: {{ $.Values.frontend.service.port }}
{{- end }}
{{- end }}
{{- end }}
---
@ -36,14 +40,18 @@ metadata:
spec:
ingressClassName: {{ .Values.backend.ingress.className }}
rules:
- host: {{ .Values.backend.ingress.hosts[0].host }}
{{- range .Values.backend.ingress.hosts }}
- host: {{ .host }}
http:
paths:
- path: /api
pathType: Prefix
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: navix-backend
port:
number: {{ .Values.backend.service.port }}
number: {{ $.Values.backend.service.port }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -1,8 +1,8 @@
frontend:
image:
repository: harbor.dvirlabs.com/my-apps/navix-front
tag: latest
repository: harbor.dvirlabs.com/my-apps/navix-frontend
pullPolicy: IfNotPresent
tag: master-4fc5494
service:
type: ClusterIP
port: 80
@ -21,12 +21,12 @@ frontend:
API_BASE: "https://navix.dvirlabs.com/api"
MINIO_ENDPOINT: "s3.dvirlabs.com"
MINIO_BUCKET: "navix-icons"
tag: master-4fc5494
backend:
image:
repository: harbor.dvirlabs.com/my-apps/navix-back
tag: latest
repository: harbor.dvirlabs.com/my-apps/navix-backend
pullPolicy: IfNotPresent
tag: master-4fc5494
service:
type: ClusterIP
port: 8000
@ -42,7 +42,8 @@ backend:
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.tls: "true"
hosts:
- host: navix.dvirlabs.com
- host: api-navix.dvirlabs.com
paths:
- path: /api
pathType: Prefix