Fix: stupid llm

This commit is contained in:
Grail Finder
2025-05-01 17:24:15 +03:00
parent b3a730b3dd
commit 6af41f061f
12 changed files with 460 additions and 34 deletions

35
main.go Normal file
View File

@ -0,0 +1,35 @@
package main
import (
"fmt"
"net/http"
"golias/handlers"
"time"
)
// TODO: add config as param
func ListenToRequests(port string) error{
mux := http.NewServeMux()
server := &http.Server{
Addr: port,
ReadTimeout: time.Second * 5,
WriteTimeout: time.Second * 5,
}
fs := http.FileServer(http.Dir("assets/"))
mux.Handle("GET /assets/", http.StripPrefix("/assets/", fs))
mux.HandleFunc("GET /ping", handlers.HandlePing)
mux.HandleFunc("GET /", handlers.HandleHome)
fmt.Println("Listening", "addr", port)
return server.ListenAndServe()
}
func main() {
port := ":3000"
fmt.Printf("Starting server on %s\n", port)
err := ListenToRequests(port)
if err != nil {
panic(err)
}
}