init commit. Makefile. Dokerimage, Dockerfile, Docker-compose.yaml

This commit is contained in:
valitovgaziz
2024-08-04 22:40:36 +05:00
commit 0487e3771a
8 changed files with 82 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
FROM golang:1.22.5
WORKDIR /app
COPY . .
RUN go mod tidy
RUN go build -o bin/api.exe cmd/main.go
ENTRYPOINT [ "bin/api.exe" ]
BIN
View File
Binary file not shown.
+17
View File
@@ -0,0 +1,17 @@
package main
import (
"net/http"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
)
func main() {
r := chi.NewRouter()
r.Use(middleware.Logger)
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("welcome developer"))
})
http.ListenAndServe(":8000", r)
}
+5
View File
@@ -0,0 +1,5 @@
module api
go 1.22.5
require github.com/go-chi/chi/v5 v5.1.0
+2
View File
@@ -0,0 +1,2 @@
github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw=
github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=