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:
commit
71ce650fa0
4
main.go
4
main.go
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue