minimal go backend w/ dockerfile
This commit is contained in:
21
backend/cmd/app/main.go
Normal file
21
backend/cmd/app/main.go
Normal 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")
|
||||
}
|
||||
Reference in New Issue
Block a user