This commit is contained in:
I_AM_TINE
2023-01-25 11:07:32 +07:00
commit ddb9307704
7 changed files with 56 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
+19
View File
@@ -0,0 +1,19 @@
FROM golang:alpine as builder
WORKDIR /app
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
FROM alpine
WORKDIR /app
COPY ./static ./static
COPY --from=builder /app/serviceapifrontend .
EXPOSE 4000
ENTRYPOINT [ "/app/serviceapifrontend" ]
+2
View File
@@ -0,0 +1,2 @@
# server
+3
View File
@@ -0,0 +1,3 @@
module github.com/ThisTine/simple-http-server
go 1.17
View File
+18
View File
@@ -0,0 +1,18 @@
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
fs := http.FileServer(http.Dir("./static"))
http.Handle("/", fs)
fmt.Print("Listening on 4000")
err := http.ListenAndServe(":4000", nil)
if err != nil {
log.Fatal(err)
}
}
+12
View File
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Default</title>
</head>
<body>
<h1>Default page</h1>
</body>
</html>