You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea-fork-majority-judgment/gogs.go

45 lines
944 B

10 years ago
// 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 (
10 years ago
"fmt"
"net/http"
10 years ago
"github.com/codegangsta/martini"
10 years ago
"github.com/martini-contrib/render"
10 years ago
"github.com/gogits/gogs/routers"
"github.com/gogits/gogs/routers/user"
10 years ago
"github.com/gogits/gogs/utils"
"github.com/gogits/gogs/utils/log"
10 years ago
)
const APP_VER = "0.0.0.0218"
10 years ago
10 years ago
func init() {
}
10 years ago
func main() {
log.Info("%s %s", utils.Cfg.MustValue("", "APP_NAME"), APP_VER)
10 years ago
10 years ago
m := martini.Classic()
10 years ago
// Middleware.
m.Use(render.Renderer())
// Routers.
m.Get("/", routers.Dashboard)
m.Get("/user/signin", user.SignIn)
m.Any("/user/signup", user.SignUp)
10 years ago
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)
10 years ago
}