Initial commit: Go starter template
هذا الالتزام موجود في:
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
FROM golang:1.21-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN go build -o main .
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
CMD ["./main"]
|
15
main.go
Normal file
15
main.go
Normal 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
requirements.txt
Normal file
3
requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Go uses go.mod for dependencies
|
||||||
|
# This file is for reference only
|
||||||
|
go 1.21
|
المرجع في مشكلة جديدة
حظر مستخدم