add http-server part 8.1

This commit is contained in:
Christopher Hase 2025-04-14 10:01:35 +02:00
parent 05d0522a04
commit 173c444c62
6 changed files with 61 additions and 14 deletions

View file

@ -77,7 +77,7 @@ async function sendEmail(content: string) {
html: html(content)
});
console.log("E-Mail sent: ", info.messageId);
console.log("E-Mail sent: ", info.messageId + "\n");
} catch (error) {
console.error("Error Sending E-Mail:", error);
}

View file

@ -3,15 +3,9 @@ function handleClick(): void {
console.log("Der Button wurde geklickt!");
alert("Hallo von TypeScript!");
//fetch("http://localhost:8090/api/command", {
//fetch("/api/command", {
fetch("http://192-168-197-2.c-one-infra.de:8090/api/command", {
method: "POST"
/*,
headers: {
"Content-Type": "application/json", // Füge dies hinzu, wenn du JSON sendest
}*/
})
//fetch("http://192-168-197-2.c-one-infra.de:8090/api/command", { method: "POST" })
fetch("/iching/api/command", { method: "POST" })
.then(res => res.text())
.then(text => console.log("Server sagt:", text))
.catch(error => console.error("Fehler:", error));
@ -22,6 +16,10 @@ document.addEventListener("DOMContentLoaded", () => {
button?.addEventListener("click", handleClick);
});
//fetch("http://localhost:8090/api/command", {
//fetch("/api/command", {
/*fetch("/api/command", { method: "POST" })
.then(res => res.text())
.then(text => console.log("Server sagt:", text));*/

View file

@ -11,6 +11,13 @@ spec:
- host: 192-168-197-2.c-one-infra.de
http:
paths:
- path: /iching/api(/|$)(.*)
pathType: ImplementationSpecific
backend:
service:
name: iching-service
port:
number: 81
- path: /iching(/|$)(.*)
pathType: ImplementationSpecific
backend:
@ -22,3 +29,6 @@ spec:
- hosts:
- 192-168-197-2.c-one-infra.de
secretName: argocd-net-tls

24
old.ingress.yaml Normal file
View file

@ -0,0 +1,24 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: iching-ingress
namespace: argocd
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
ingressClassName: nginx
rules:
- host: 192-168-197-2.c-one-infra.de
http:
paths:
- path: /iching(/|$)(.*)
pathType: ImplementationSpecific
backend:
service:
name: iching-service
port:
number: 80
tls:
- hosts:
- 192-168-197-2.c-one-infra.de
secretName: argocd-net-tls

13
old.service.yaml Normal file
View file

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: iching-service
namespace: argocd
spec:
selector:
app: iching-broker
ports:
- protocol: TCP
port: 80
targetPort: 8080
type: ClusterIP

View file

@ -7,7 +7,9 @@ spec:
selector:
app: iching-broker
ports:
- protocol: TCP
- name: frontend
port: 80
targetPort: 8080
type: ClusterIP
- name: backend
port: 81
targetPort: 8090