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 (
|
||||
"embed"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
|
@ -23,6 +24,10 @@ func setReader(state string) error {
|
|||
|
||||
func main() {
|
||||
setReader("on")
|
||||
webUI, err := fs.Sub(webUI, "dist")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
http.Handle("/", http.FileServerFS(webUI))
|
||||
|
||||
http.HandleFunc("POST /api/reader/{state}", func(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue