Initial commit: Go starter template

This commit is contained in:
mustafalasheen
2025-04-15 15:29:03 +02:00
commit 13796d8437
3 changed files with 29 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
FROM golang:1.21-alpine
WORKDIR /app
COPY . .
RUN go build -o main .
EXPOSE 8080
CMD ["./main"]
+15
View File
@@ -0,0 +1,15 @@
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "MARHABA in Ghaymah")
})
fmt.Println("Server starting on port 8080...")
http.ListenAndServe(":8080", nil)
}
+3
View File
@@ -0,0 +1,3 @@
# Go uses go.mod for dependencies
# This file is for reference only
go 1.21