add http-server part 6
This commit is contained in:
parent
21cbfb31c9
commit
c8d6cc124d
3 changed files with 8 additions and 5 deletions
|
@ -28,4 +28,6 @@ COPY --from=rust-build /usr/local/cargo/bin/iching /usr/local/bin/iching
|
||||||
RUN mkdir -p dist/iching
|
RUN mkdir -p dist/iching
|
||||||
RUN cp dist/*.js dist/iching/
|
RUN cp dist/*.js dist/iching/
|
||||||
|
|
||||||
|
RUN node server.js
|
||||||
|
|
||||||
CMD ["npx", "http-server", "dist", "-p", "8080", "--mime", "application/javascript=js"]
|
CMD ["npx", "http-server", "dist", "-p", "8080", "--mime", "application/javascript=js"]
|
9
event.ts
9
event.ts
|
@ -3,12 +3,13 @@ function handleClick(): void {
|
||||||
console.log("Der Button wurde geklickt!");
|
console.log("Der Button wurde geklickt!");
|
||||||
alert("Hallo von TypeScript!");
|
alert("Hallo von TypeScript!");
|
||||||
|
|
||||||
/*fetch("/api/command", { method: "POST" })
|
fetch("/api/command", { method: "POST" })
|
||||||
.then(res => res.text())
|
.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" })
|
|
||||||
|
/*fetch("https://192-168-197-2.c-one-infra.de/api/command", { method: "POST" })
|
||||||
.then(res => res.text())
|
.then(res => res.text())
|
||||||
.then(text => console.log("Server sagt:", text));
|
.then(text => console.log("Server sagt:", text)); */
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
|
|
@ -12,4 +12,4 @@ app.post('/api/command', (req, res) => {
|
||||||
|
|
||||||
app.listen(port, '0.0.0.0', () => {
|
app.listen(port, '0.0.0.0', () => {
|
||||||
console.log(`Server läuft auf http://0.0.0.0:${port}`);
|
console.log(`Server läuft auf http://0.0.0.0:${port}`);
|
||||||
});
|
});
|
Loading…
Reference in a new issue