trim /public from http
parent
b006333035
commit
58cafcfaa3
|
|
@ -6,6 +6,7 @@ import (
|
|||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
"log"
|
||||
"maps"
|
||||
"net/http"
|
||||
|
|
@ -29,9 +30,13 @@ import (
|
|||
var _staticFileDir embed.FS
|
||||
var publicHandler = func() http.Handler {
|
||||
if os.Getenv("DEBUG") != "" {
|
||||
return http.FileServer(http.Dir("./http"))
|
||||
return http.FileServer(http.Dir("./http/public"))
|
||||
}
|
||||
return http.FileServer(http.FS(_staticFileDir))
|
||||
sub, err := fs.Sub(_staticFileDir, "public")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return http.FileServer(http.FS(sub))
|
||||
}()
|
||||
|
||||
func Main() {
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@
|
|||
<body style="height: 100%;" onload="init();">
|
||||
<h1>Moolah2 Hub</h1>
|
||||
<ul style="line-height: 3em;">
|
||||
<li><a href="/public/transactions.html">Transactions on Shared Chase</a></li>
|
||||
<li><a href="/public/explore.html">Explore Bel's Money</a></li>
|
||||
<li><a href="/transactions.html">Transactions on Shared Chase</a></li>
|
||||
<li><a href="/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=YYYY-MM&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=YYYY-MM&prediction=autoContributions=&predictFixedGrowth=VBTLX=0&whatIf=AssetAccount:Cash%20$%20-.10000&=">Expect Bel's Expenses</a></li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
}
|
||||
function callback(responseBody, responseStatus) {
|
||||
}
|
||||
var f = String(window.location).split("/public/transactions.html")[1]
|
||||
var f = String(window.location).split("/transactions.html")[1]
|
||||
if (!f) {
|
||||
f = "/moolah.dat"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue