Update flags

master
bel 2019-12-07 14:09:24 -07:00
parent de93fa2145
commit 8728b7d694
2 changed files with 10 additions and 10 deletions

View File

@ -8,12 +8,12 @@ import (
) )
var ( var (
Port string Port string
StoreType string StoreType string
StoreAddr string StoreAddr string
StoreUser string StoreUser string
StorePass string StorePass string
Public string MyTinyTodo string
) )
func init() { func init() {
@ -31,7 +31,7 @@ func Refresh() {
as.Append(args.STRING, "storeaddr", "addr of store", "") as.Append(args.STRING, "storeaddr", "addr of store", "")
as.Append(args.STRING, "storeuser", "user of store", "") as.Append(args.STRING, "storeuser", "user of store", "")
as.Append(args.STRING, "storepass", "pass of store", "") as.Append(args.STRING, "storepass", "pass of store", "")
as.Append(args.STRING, "public", "url of php server", "http://localhost:38808") as.Append(args.STRING, "mtt", "url of php server", "http://localhost:38808")
if err := as.Parse(); err != nil { if err := as.Parse(); err != nil {
panic(err) panic(err)
} }
@ -41,5 +41,5 @@ func Refresh() {
StoreAddr = as.Get("storeaddr").GetString() StoreAddr = as.Get("storeaddr").GetString()
StoreUser = as.Get("storeuser").GetString() StoreUser = as.Get("storeuser").GetString()
StorePass = as.Get("storepass").GetString() StorePass = as.Get("storepass").GetString()
Public = as.Get("public").GetString() MyTinyTodo = as.Get("mtt").GetString()
} }

View File

@ -37,7 +37,7 @@ func (s *Server) Routes() error {
} }
func (s *Server) index(w http.ResponseWriter, r *http.Request) { func (s *Server) index(w http.ResponseWriter, r *http.Request) {
f, err := os.Open(path.Join(config.Public, "index.php")) f, err := os.Open(path.Join(config.MyTinyTodo, "index.php"))
if err != nil { if err != nil {
http.Error(w, err.Error(), http.StatusNotFound) http.Error(w, err.Error(), http.StatusNotFound)
return return
@ -47,7 +47,7 @@ func (s *Server) index(w http.ResponseWriter, r *http.Request) {
} }
func (s *Server) phpProxy(w http.ResponseWriter, r *http.Request) { func (s *Server) phpProxy(w http.ResponseWriter, r *http.Request) {
url, err := url.Parse(config.Public) url, err := url.Parse(config.MyTinyTodo)
if err != nil { if err != nil {
log.Println(err) log.Println(err)
} else { } else {