Beispiel #1
0
func main() {
	xweb.AddAction(&MainAction{})
	xweb.RootApp().AppConfig.CheckXsrf = false
	go xweb.Run("0.0.0.0:9999")

	values := url.Values{"key": {"Value"}, "id": {"123"},
		"user.id": {"2"}, "user2.ptrId": {"3"},
		"user2.id": {"4"}, "user2.child.id": {"66"},
		"keys":  {"1", "2", "3"},
		"keys2": {"1", "2", "3"},
	}
	resp, err := http.PostForm("http://127.0.0.1:9999/", values)
	if err != nil {
		fmt.Println(err)
		return
	}

	bytes, err := ioutil.ReadAll(resp.Body.(io.Reader))
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(bytes))

	var s chan int
	<-s
}
Beispiel #2
0
func main() {
	xweb.RootApp().AppConfig.SessionOn = false
	xweb.AddRouter("/", &MainAction{})

	config, err := xweb.SimpleTLSConfig("cert.pem", "key.pem")
	if err != nil {
		fmt.Println(err)
		return
	}

	xweb.RunTLS("0.0.0.0:9999", config)
}
Beispiel #3
0
func main() {
	xweb.RootApp().AppConfig.SessionOn = false
	xweb.AddRouter("/", &MainAction{})
	xweb.Run("0.0.0.0:9999")
}