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/gogs.go

45 lines
944 B

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