first commit

This commit is contained in:
bruno 2023-07-29 21:55:08 -04:00
commit 5cb003f241
8 changed files with 29 additions and 0 deletions

6
Dockerfile Normal file
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"]

0
README.md Normal file
View File

BIN
assets/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

2
assets/js/script.js Normal file
View File

@ -0,0 +1,2 @@
console.log('Hello from script.js!');
alert('JavaScript is working!');

4
build_dockerImage.sh Executable file
View File

@ -0,0 +1,4 @@
docker build -t mywebserver:1.0 .
docker run -d -p 8000:8000 mywebserver:1.0

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module github.com/johndoe/mywebserver
go 1.20

12
main.go Normal file
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
templates/index.html Normal file
View File

@ -0,0 +1,2 @@
<img src="/static/img/logo.png">
<script src="/static/js/script.js"></script>