From c9c4800d68193ef13a5fb08b2d8f5240fbd66ce8 Mon Sep 17 00:00:00 2001 From: bel Date: Tue, 14 Oct 2025 21:38:32 -0600 Subject: [PATCH] it is something --- cmd/tts-room/main.go | 9 +++++ src/public/index.html | 77 +++++++++++++++++++++++++++++++++++++++++++ src/server/server.go | 2 +- 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 src/public/index.html diff --git a/cmd/tts-room/main.go b/cmd/tts-room/main.go index da29a2c..9454b3f 100644 --- a/cmd/tts-room/main.go +++ b/cmd/tts-room/main.go @@ -1,4 +1,13 @@ package main +import ( + "net/http" + "tts-room/src/server" +) + func main() { + s := server.NewServer() + if err := http.ListenAndServe(":10000", s); err != nil { + panic(err) + } } diff --git a/src/public/index.html b/src/public/index.html new file mode 100644 index 0000000..c6c0c2f --- /dev/null +++ b/src/public/index.html @@ -0,0 +1,77 @@ + + + + + + + + +
+

Click "Open" to create a connection to the server, +"Send" to send a message to the server and "Close" to close the connection. +You can change the message and send multiple times. +

+

+ + +

+ +

+
+
+
+ + diff --git a/src/server/server.go b/src/server/server.go index 5e3b852..8229ace 100644 --- a/src/server/server.go +++ b/src/server/server.go @@ -18,7 +18,7 @@ func (s Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { log.Println("[ws]", err) } default: - http.FileServer(http.Dir("./public")).ServeHTTP(w, r) + http.FileServer(http.Dir("./src/public")).ServeHTTP(w, r) } }