move html to static folder
This commit is contained in:
9
main.go
9
main.go
@@ -11,6 +11,8 @@ import (
|
|||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var staticFolder = "./web/static/"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
env.Load(".env")
|
env.Load(".env")
|
||||||
@@ -23,7 +25,6 @@ func main() {
|
|||||||
fmt.Println("upload folder for images not found: ", uploadFolder)
|
fmt.Println("upload folder for images not found: ", uploadFolder)
|
||||||
fmt.Println("use fallback")
|
fmt.Println("use fallback")
|
||||||
uploadFolder = "./images"
|
uploadFolder = "./images"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("upload folder for images: ", uploadFolder)
|
fmt.Println("upload folder for images: ", uploadFolder)
|
||||||
@@ -37,17 +38,17 @@ func main() {
|
|||||||
|
|
||||||
r.HandleFunc("/api/delete", handlers.DeleteHandler).Methods("POST")
|
r.HandleFunc("/api/delete", handlers.DeleteHandler).Methods("POST")
|
||||||
r.HandleFunc("/manage", func(w http.ResponseWriter, r *http.Request) {
|
r.HandleFunc("/manage", func(w http.ResponseWriter, r *http.Request) {
|
||||||
http.ServeFile(w, r, "manage.html")
|
http.ServeFile(w, r, staticFolder+"manage.html")
|
||||||
})
|
})
|
||||||
|
|
||||||
r.HandleFunc("/api/info", handlers.InfoHandler).Methods("GET")
|
r.HandleFunc("/api/info", handlers.InfoHandler).Methods("GET")
|
||||||
|
|
||||||
r.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
r.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
http.ServeFile(w, r, "index.html")
|
http.ServeFile(w, r, staticFolder+"index.html")
|
||||||
})
|
})
|
||||||
// We add a route for the slideshow page specifically
|
// We add a route for the slideshow page specifically
|
||||||
r.HandleFunc("/slideshow", func(w http.ResponseWriter, r *http.Request) {
|
r.HandleFunc("/slideshow", func(w http.ResponseWriter, r *http.Request) {
|
||||||
http.ServeFile(w, r, "frame.html")
|
http.ServeFile(w, r, staticFolder+"frame.html")
|
||||||
})
|
})
|
||||||
|
|
||||||
host := env.Host.GetValue()
|
host := env.Host.GetValue()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Go File Center</title>
|
<title>Slideshow App</title>
|
||||||
<script src="https://cdn.tailwindcss.com"></script>
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-gray-50 min-h-screen flex items-center justify-center p-6">
|
<body class="bg-gray-50 min-h-screen flex items-center justify-center p-6">
|
||||||
Reference in New Issue
Block a user