Exemple #1
0
func main() {

	server, err := wk.NewDefaultServer()

	if err != nil {
		fmt.Println("NewDefaultServer error", err)
		return
	}

	for _, fn := range boot.Inits {
		fn(server)
	}

	server.Start()

}
Exemple #2
0
func main() {

	server, err := wk.NewDefaultServer()
	if err != nil {
		fmt.Println("NewDefaultServer error", err)
		return
	}

	server.Processes.Remove("_static")
	server.Config.ViewEnable = false
	server.Config.SessionEnable = false

	controller := controller.NewBasicController()

	// url: /demo/xxx/xxx
	// route to controller
	server.RouteTable.Path("/basic/{action}/{id}").ToController(controller)

	server.Start()

}