init commit. Makefile. Dokerimage, Dockerfile, Docker-compose.yaml
This commit is contained in:
@@ -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" ]
|
||||
Binary file not shown.
@@ -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)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
module api
|
||||
|
||||
go 1.22.5
|
||||
|
||||
require github.com/go-chi/chi/v5 v5.1.0
|
||||
@@ -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=
|
||||
Reference in New Issue
Block a user