diff --git a/event.ts b/event.ts index 19cc125..e157d02 100644 --- a/event.ts +++ b/event.ts @@ -1,13 +1,16 @@ -import { executeCommand } from './broker.js'; +//import { executeCommand } from './broker.js'; function handleClick(): void { console.log("Der Button wurde geklickt!"); alert("Hallo von TypeScript!"); //executeCommand(); - fetch("/api/command", { method: "POST" }) + /*fetch("/api/command", { method: "POST" }) .then(res => res.text()) - .then(text => console.log("Server sagt:", text)); + .then(text => console.log("Server sagt:", text));*/ + fetch("https://192-168-197-2.c-one-infra.de/api/command", { method: "POST" }) + .then(res => res.text()) + .then(text => console.log("Server sagt:", text)); } document.addEventListener("DOMContentLoaded", () => { diff --git a/server.ts b/server.ts index 231c960..4aa21b5 100644 --- a/server.ts +++ b/server.ts @@ -3,13 +3,13 @@ import express from 'express'; import { executeCommand } from './broker'; const app = express(); -const port = 8080; +const port = 8090; app.post('/api/command', (req, res) => { executeCommand(); res.status(200).send('Command executed'); }); -app.listen(port, () => { - console.log(`Server läuft auf http://localhost:${port}`); -}); \ No newline at end of file +app.listen(port, '0.0.0.0', () => { + console.log(`Server läuft auf http://0.0.0.0:${port}`); + }); \ No newline at end of file