minimal go backend w/ dockerfile

This commit is contained in:
2024-08-02 20:52:42 +03:00
parent 6491f2b547
commit ded3b78c58
4 changed files with 37 additions and 0 deletions

21
backend/cmd/app/main.go Normal file
View File

@@ -0,0 +1,21 @@
package main
import (
//"encoding/json"
"log"
"net/http"
"fmt"
"github.com/gorilla/mux"
)
func main() {
router := mux.NewRouter()
router.HandleFunc("/ping", ping).Methods("GET")
log.Fatal(http.ListenAndServe(":8080", router))
}
func ping(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "pong")
}