Remove /dist/ prefix from served files
This commit is contained in:
parent
6bddf284fe
commit
fcd1c22738
1 changed files with 5 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"embed"
|
"embed"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io/fs"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
@ -23,6 +24,10 @@ func setReader(state string) error {
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
setReader("on")
|
setReader("on")
|
||||||
|
webUI, err := fs.Sub(webUI, "dist")
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
http.Handle("/", http.FileServerFS(webUI))
|
http.Handle("/", http.FileServerFS(webUI))
|
||||||
|
|
||||||
http.HandleFunc("POST /api/reader/{state}", func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("POST /api/reader/{state}", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue