mirror of
https://github.com/ThisTine/simple-http-server.git
synced 2026-08-18 23:18:48 +07:00
INIT
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
+19
@@ -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" ]
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user