Ejemplo n.º 1
0
func main() {
	configtext, _err := ioutil.ReadFile("config.json")
	if _err != nil {
		fmt.Println(_err)
	}
	var conf ServerConfig
	err := json.Unmarshal(configtext, &conf)
	if err != nil {
		fmt.Println(err)
	}
	//WEB ROUTES
	web.Get("/()", IndexLoadGet)
	web.Get("/static/(.*)", Sendstatic)
	web.Get("/post/(.*)", GetSinglePost)
	//STARTING PROCEDURE
	if conf.Fcgi == "false" {
		fmt.Println("FCGI:", conf.Fcgi)
		fmt.Println("PORT:", conf.Port)
		web.Run("0.0.0.0:" + conf.Port)
	} else {
		fmt.Println("FCGI:", conf.Fcgi)
		fmt.Println("PORT:", conf.Port)
		web.RunFcgi("0.0.0.0:" + conf.Port)
	}
}
Ejemplo n.º 2
0
func main() {
	print("V0.34\n")
	web.Get("/()", IndexLoad)
	//web.Get("/(login)", login.LoadGet)
	//web.Post("/(login)", login.LoadPost)
	web.Get("/admin/(.*)", AdminLoadGet)
	web.Post("/admin/newpost(.*)", AdminNewPost)
	web.Get("/inc/(.*)", Sendstatic)
	web.Run("0.0.0.0:9999")
}