From 96b317d3fff3884dd08061d84e11a49495f83a4b Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 12 Feb 2014 14:54:09 -0500 Subject: Init commit --- gogs.go | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'gogs.go') diff --git a/gogs.go b/gogs.go index 8a4b9e00..c0b11fb8 100644 --- a/gogs.go +++ b/gogs.go @@ -5,15 +5,37 @@ package main import ( + "fmt" + "net/http" + "github.com/codegangsta/martini" + "github.com/martini-contrib/render" "github.com/gogits/gogs/routers" + "github.com/gogits/gogs/utils" + "github.com/gogits/gogs/utils/log" ) const APP_VER = "0.0.0.0212" +func init() { + +} + func main() { + log.Info("App Name: %s", utils.Cfg.MustValue("", "APP_NAME")) + m := martini.Classic() - m.Get("/", routers.HomeGet) - m.Run() + + // Middleware. + m.Use(render.Renderer()) + + // Routers. + m.Get("/", routers.Home) + + listenAddr := fmt.Sprintf("%s:%s", + utils.Cfg.MustValue("server", "HTTP_ADDR"), + utils.Cfg.MustValue("server", "HTTP_PORT", "3000")) + log.Info("Listen: %s", listenAddr) + http.ListenAndServe(listenAddr, m) } -- cgit v1.2.3