Merge pull request 'changed to work with Domain' (#17) from readme_file_changes into main

Reviewed-on: Fabelous/GO-Translator#17
This commit is contained in:
Falko Victor Habel 2024-03-19 10:38:47 +00:00
commit 71ce650fa0
1 changed files with 2 additions and 2 deletions

View File

@ -217,7 +217,7 @@ func handleRequest(w http.ResponseWriter, r *http.Request) {
func main() {
// Define the HTTP handler function
http.HandleFunc("/api", handleRequest)
http.HandleFunc("", handleRequest)
// Get the port number from the environment variable or use a default value
port := "53184"
@ -226,7 +226,7 @@ func main() {
}
// Start the HTTP server
fmt.Printf("Listening on :%s...\n", port)
fmt.Printf("Listening :%s...\n", port)
err := http.ListenAndServe(":"+port, nil)
if err != nil {
log.Fatalf("Failed to start server: %v", err)