first commit

This commit is contained in:
2023-07-29 21:55:08 -04:00
commit 5cb003f241
8 changed files with 29 additions and 0 deletions
+6
View File
@@ -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"]
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

+2
View File
@@ -0,0 +1,2 @@
console.log('Hello from script.js!');
alert('JavaScript is working!');
+4
View File
@@ -0,0 +1,4 @@
docker build -t mywebserver:1.0 .
docker run -d -p 8000:8000 mywebserver:1.0
+3
View File
@@ -0,0 +1,3 @@
module github.com/johndoe/mywebserver
go 1.20
+12
View File
@@ -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!"))
}
+2
View File
@@ -0,0 +1,2 @@
<img src="/static/img/logo.png">
<script src="/static/js/script.js"></script>