summaryrefslogtreecommitdiffstats
path: root/web.go
diff options
context:
space:
mode:
Diffstat (limited to 'web.go')
-rw-r--r--web.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/web.go b/web.go
index fe3596e220..2a9df17c8d 100644
--- a/web.go
+++ b/web.go
@@ -21,6 +21,7 @@ import (
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/middleware"
"github.com/gogits/gogs/routers"
+ "github.com/gogits/gogs/routers/dev"
"github.com/gogits/gogs/routers/repo"
"github.com/gogits/gogs/routers/user"
)
@@ -57,6 +58,7 @@ func newMartini() *martini.ClassicMartini {
}
func runWeb(*cli.Context) {
+ base.NewServices()
checkRunMode()
log.Info("%s %s", base.AppName, base.AppVer)
@@ -113,6 +115,10 @@ func runWeb(*cli.Context) {
m.Get("/:username/:reponame", ignSignIn, middleware.RepoAssignment(true), repo.Single)
+ if martini.Env == martini.Dev {
+ m.Get("/template/**", dev.TemplatePreview)
+ }
+
listenAddr := fmt.Sprintf("%s:%s",
base.Cfg.MustValue("server", "HTTP_ADDR"),
base.Cfg.MustValue("server", "HTTP_PORT", "3000"))