This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
@@ -16,12 +17,17 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
_ "embed"
|
||||
|
||||
"github.com/go-echarts/go-echarts/v2/charts"
|
||||
"github.com/go-echarts/go-echarts/v2/opts"
|
||||
"gogs.inhome.blapointe.com/ana-ledger/src/ana"
|
||||
"gogs.inhome.blapointe.com/ana-ledger/src/ledger"
|
||||
)
|
||||
|
||||
//go:embed public/*
|
||||
var staticFileDir embed.FS
|
||||
|
||||
func Main() {
|
||||
foo := flag.String("foo", "bal", "bal or reg")
|
||||
likeName := flag.String("like-name", ".", "regexp to match")
|
||||
@@ -55,7 +61,7 @@ func Main() {
|
||||
if *httpOutput != "" {
|
||||
foo := func(w http.ResponseWriter, r *http.Request) {
|
||||
if !strings.HasPrefix(r.URL.Path, "/api") {
|
||||
http.FileServer(http.Dir("./http/public")).ServeHTTP(w, r)
|
||||
http.FileServer(http.FS(staticFileDir)).ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user