bench-forgejo/gogs.go

42 lines
826 B
Go
Raw Normal View History

2014-02-12 23:19:46 +05:30
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package main
import (
2014-02-13 01:24:09 +05:30
"fmt"
"net/http"
2014-02-12 23:19:46 +05:30
"github.com/codegangsta/martini"
2014-02-13 01:24:09 +05:30
"github.com/martini-contrib/render"
2014-02-12 23:19:46 +05:30
"github.com/gogits/gogs/routers"
2014-02-13 01:24:09 +05:30
"github.com/gogits/gogs/utils"
"github.com/gogits/gogs/utils/log"
2014-02-12 23:19:46 +05:30
)
const APP_VER = "0.0.0.0212"
2014-02-13 01:24:09 +05:30
func init() {
}
2014-02-12 23:19:46 +05:30
func main() {
2014-02-13 01:24:09 +05:30
log.Info("App Name: %s", utils.Cfg.MustValue("", "APP_NAME"))
2014-02-12 23:19:46 +05:30
m := martini.Classic()
2014-02-13 01:24:09 +05:30
// 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)
2014-02-12 23:19:46 +05:30
}