commit 5cb003f24134fa5d8d17afaeb1f949195bc69263 Author: bruno Date: Sat Jul 29 21:55:08 2023 -0400 first commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ae0a1fb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM golang:1.13 +RUN go get -u github.com/johndoe/mywebserver/template/... +WORKDIR /app +COPY . . +RUN go install . +CMD ["/app/myweb"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/assets/img/logo.png b/assets/img/logo.png new file mode 100644 index 0000000..d9ea760 Binary files /dev/null and b/assets/img/logo.png differ diff --git a/assets/js/script.js b/assets/js/script.js new file mode 100644 index 0000000..14a1f6f --- /dev/null +++ b/assets/js/script.js @@ -0,0 +1,2 @@ +console.log('Hello from script.js!'); +alert('JavaScript is working!'); diff --git a/build_dockerImage.sh b/build_dockerImage.sh new file mode 100755 index 0000000..646043a --- /dev/null +++ b/build_dockerImage.sh @@ -0,0 +1,4 @@ + +docker build -t mywebserver:1.0 . + +docker run -d -p 8000:8000 mywebserver:1.0 diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f2ca73d --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/johndoe/mywebserver + +go 1.20 diff --git a/main.go b/main.go new file mode 100644 index 0000000..29300ae --- /dev/null +++ b/main.go @@ -0,0 +1,12 @@ +package main + +import "net/http" + +func main() { + http.HandleFunc("/", hello) + http.ListenAndServe(":8000", nil) +} + +func hello(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("Hello World!")) +} diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..aff0125 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,2 @@ + +