Update flags
parent
de93fa2145
commit
8728b7d694
|
|
@ -13,7 +13,7 @@ var (
|
|||
StoreAddr string
|
||||
StoreUser string
|
||||
StorePass string
|
||||
Public string
|
||||
MyTinyTodo string
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
@ -31,7 +31,7 @@ func Refresh() {
|
|||
as.Append(args.STRING, "storeaddr", "addr of store", "")
|
||||
as.Append(args.STRING, "storeuser", "user 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 {
|
||||
panic(err)
|
||||
}
|
||||
|
|
@ -41,5 +41,5 @@ func Refresh() {
|
|||
StoreAddr = as.Get("storeaddr").GetString()
|
||||
StoreUser = as.Get("storeuser").GetString()
|
||||
StorePass = as.Get("storepass").GetString()
|
||||
Public = as.Get("public").GetString()
|
||||
MyTinyTodo = as.Get("mtt").GetString()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func (s *Server) Routes() error {
|
|||
}
|
||||
|
||||
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 {
|
||||
http.Error(w, err.Error(), http.StatusNotFound)
|
||||
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) {
|
||||
url, err := url.Parse(config.Public)
|
||||
url, err := url.Parse(config.MyTinyTodo)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue