switch to go backend
All checks were successful
Build and Deploy Website / build (push) Successful in 2m26s
All checks were successful
Build and Deploy Website / build (push) Successful in 2m26s
This commit is contained in:
3
Backend/go.mod
Normal file
3
Backend/go.mod
Normal file
@@ -0,0 +1,3 @@
|
||||
module smpark.in
|
||||
|
||||
go 1.23
|
||||
31
Backend/main.go
Normal file
31
Backend/main.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func main() {
|
||||
publicDir := "./public"
|
||||
spaIndex := filepath.Join(publicDir, "app", "index.html")
|
||||
|
||||
fs := http.FileServer(http.Dir(publicDir))
|
||||
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
// Try to serve the static file
|
||||
path := filepath.Join(publicDir, filepath.Clean(r.URL.Path))
|
||||
if info, err := os.Stat(path); err == nil && !info.IsDir() {
|
||||
fs.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
// Fall back to SPA index for client-side routing
|
||||
http.ServeFile(w, r, spaIndex)
|
||||
})
|
||||
|
||||
addr := ":8080"
|
||||
log.Printf("Listening on %s", addr)
|
||||
log.Fatal(http.ListenAndServe(addr, nil))
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHZR4mQ31/kYqSOc2CWN7iZVmF/6f
|
||||
6Rg39BboB9K8ckj02PvNK/JheaOaQWYuNirsnfn1cGBmhE4k8p6hL2dLvQ==
|
||||
-----END PUBLIC KEY-----
|
||||
4
Backend/public/favicon.svg
Normal file
4
Backend/public/favicon.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
||||
<rect width="100" height="100" rx="16" fill="#9370db"/>
|
||||
<text x="50" y="68" font-family="system-ui, sans-serif" font-size="48" font-weight="bold" fill="white" text-anchor="middle">SP</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 264 B |
BIN
Backend/public/images/me.jpg
Normal file
BIN
Backend/public/images/me.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 544 KiB |
BIN
Backend/public/images/trees.jpg
Normal file
BIN
Backend/public/images/trees.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
Reference in New Issue
Block a user