This commit is contained in:
2026-06-02 05:14:07 +03:00
commit c5eb62534a
8 changed files with 153 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
package main
import (
// "context"
"fmt"
"log"
"net/http"
// "os"
"github.com/gorilla/mux"
// "github.com/jackc/pgx/v5"
)
const serverAddr = ":8080"
func main() {
r := mux.NewRouter()
r.HandleFunc("/hello_world", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
fmt.Fprintln(w, "Hello world!")
}).Methods("GET")
log.Println("Server listening on ", serverAddr)
log.Fatal(http.ListenAndServe(serverAddr, r))
}