embed static files
cicd / cicd (push) Successful in 44s
Details
cicd / cicd (push) Successful in 44s
Details
parent
cb6e23a498
commit
432b2df131
|
|
@ -1,6 +1,7 @@
|
||||||
package http
|
package http
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"embed"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
@ -16,12 +17,17 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
_ "embed"
|
||||||
|
|
||||||
"github.com/go-echarts/go-echarts/v2/charts"
|
"github.com/go-echarts/go-echarts/v2/charts"
|
||||||
"github.com/go-echarts/go-echarts/v2/opts"
|
"github.com/go-echarts/go-echarts/v2/opts"
|
||||||
"gogs.inhome.blapointe.com/ana-ledger/src/ana"
|
"gogs.inhome.blapointe.com/ana-ledger/src/ana"
|
||||||
"gogs.inhome.blapointe.com/ana-ledger/src/ledger"
|
"gogs.inhome.blapointe.com/ana-ledger/src/ledger"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//go:embed public/*
|
||||||
|
var staticFileDir embed.FS
|
||||||
|
|
||||||
func Main() {
|
func Main() {
|
||||||
foo := flag.String("foo", "bal", "bal or reg")
|
foo := flag.String("foo", "bal", "bal or reg")
|
||||||
likeName := flag.String("like-name", ".", "regexp to match")
|
likeName := flag.String("like-name", ".", "regexp to match")
|
||||||
|
|
@ -55,7 +61,7 @@ func Main() {
|
||||||
if *httpOutput != "" {
|
if *httpOutput != "" {
|
||||||
foo := func(w http.ResponseWriter, r *http.Request) {
|
foo := func(w http.ResponseWriter, r *http.Request) {
|
||||||
if !strings.HasPrefix(r.URL.Path, "/api") {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
<body style="height: 100%;">
|
<body style="height: 100%;">
|
||||||
<h1>Moolah2 Hub</h1>
|
<h1>Moolah2 Hub</h1>
|
||||||
<ul style="line-height: 3em;">
|
<ul style="line-height: 3em;">
|
||||||
<li><a href="/transactions.html">Transactions on Shared Chase</a></li>
|
<li><a href="/public/transactions.html">Transactions on Shared Chase</a></li>
|
||||||
<li><a href="/explore.html">Explore Bel's Money</a></li>
|
<li><a href="/public/explore.html">Explore Bel's Money</a></li>
|
||||||
<li><a href="/api/bal?x=y&mode=bal&likeName=AssetAccount&chart=stack&predictionMonths=120&bpi=true&zoomStart=2023-06&prediction=interest=AssetAccount:Cash%20\$%200.02&prediction=contributions=AssetAccount:Bonds%20$%201875&prediction=interest=AssetAccount:Monthly%20\$%200.03&prediction=contributions=AssetAccount:Monthly%20$%202500&predictFixedGrowth=VBTLX=0.02&predictFixedGrowth=GLD=0.02&predictFixedGrowth=FXAIX=0.03&predictFixedGrowth=FSPSX=0.03&whatIf=AssetAccount:Cash%20$%20-.10000&=">Project Bel's Net Worth</a></li>
|
<li><a href="/api/bal?x=y&mode=bal&likeName=AssetAccount&chart=stack&predictionMonths=120&bpi=true&zoomStart=2023-06&prediction=interest=AssetAccount:Cash%20\$%200.02&prediction=contributions=AssetAccount:Bonds%20$%201875&prediction=interest=AssetAccount:Monthly%20\$%200.03&prediction=contributions=AssetAccount:Monthly%20$%202500&predictFixedGrowth=VBTLX=0.02&predictFixedGrowth=GLD=0.02&predictFixedGrowth=FXAIX=0.03&predictFixedGrowth=FSPSX=0.03&whatIf=AssetAccount:Cash%20$%20-.10000&=">Project Bel's Net Worth</a></li>
|
||||||
<li><a href="/api/reg?x=y&mode=reg&likeName=Withdrawal:&chart=stack&predictionMonths=3&bpi=false&zoomStart=2023-01&prediction=autoContributions=&predictFixedGrowth=VBTLX=0&whatIf=AssetAccount:Cash%20$%20-.10000&=">Expect Bel's Expenses</a></li>
|
<li><a href="/api/reg?x=y&mode=reg&likeName=Withdrawal:&chart=stack&predictionMonths=3&bpi=false&zoomStart=2023-01&prediction=autoContributions=&predictFixedGrowth=VBTLX=0&whatIf=AssetAccount:Cash%20$%20-.10000&=">Expect Bel's Expenses</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
}
|
}
|
||||||
function callback(responseBody, responseStatus) {
|
function callback(responseBody, responseStatus) {
|
||||||
}
|
}
|
||||||
var f = String(window.location).split("/transactions.html")[1]
|
var f = String(window.location).split("/public/transactions.html")[1]
|
||||||
if (!f) {
|
if (!f) {
|
||||||
f = "/moolah.dat"
|
f = "/moolah.dat"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue