Initial commit: Go starter template
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
FROM golang:1.21-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN go build -o main .
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["./main"]
|
||||
@@ -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)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
# Go uses go.mod for dependencies
|
||||
# This file is for reference only
|
||||
go 1.21
|
||||
Reference in New Issue
Block a user