Skip to content

Commit 12fe342

Browse files
committed
Formatting fixes and move router.go to routers/
1 parent 66c8f3e commit 12fe342

File tree

6 files changed

+19
-14
lines changed

6 files changed

+19
-14
lines changed

cmd/web.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ import (
1414
"strings"
1515

1616
"code.gitea.io/gitea/modules/log"
17-
"code.gitea.io/gitea/modules/router"
1817
"code.gitea.io/gitea/modules/setting"
1918
"code.gitea.io/gitea/routers"
19+
"code.gitea.io/gitea/routers/routes"
20+
2021
context2 "github.com/gorilla/context"
2122
"github.com/urfave/cli"
2223
)
@@ -58,8 +59,8 @@ func runWeb(ctx *cli.Context) error {
5859

5960
routers.GlobalInit()
6061

61-
m := router.NewMacaron()
62-
router.RegisterRoutes(m)
62+
m := routes.NewMacaron()
63+
routes.RegisterRoutes(m)
6364

6465
// Flag for port number in case first time run conflict.
6566
if ctx.IsSet("port") {

integrations/integration_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
package integrations
66

77
import (
8+
"bytes"
89
"fmt"
910
"io"
1011
"net/http"
1112
"os"
1213
"testing"
1314

1415
"code.gitea.io/gitea/models"
15-
"code.gitea.io/gitea/modules/router"
1616
"code.gitea.io/gitea/modules/setting"
1717
"code.gitea.io/gitea/routers"
18+
"code.gitea.io/gitea/routers/routes"
1819

19-
"bytes"
2020
"gopkg.in/macaron.v1"
2121
"gopkg.in/testfixtures.v2"
2222
)
@@ -31,8 +31,8 @@ func TestMain(m *testing.M) {
3131
}
3232
setting.CustomConf = appIniPath
3333
routers.GlobalInit()
34-
mac = router.NewMacaron()
35-
router.RegisterRoutes(mac)
34+
mac = routes.NewMacaron()
35+
routes.RegisterRoutes(mac)
3636

3737
var helper testfixtures.Helper
3838
if setting.UseMySQL {

integrations/signup_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212

1313
"code.gitea.io/gitea/models"
1414
"code.gitea.io/gitea/modules/setting"
15+
1516
"github.com/stretchr/testify/assert"
1617
)
1718

integrations/sqlite.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,7 @@ LEVEL = Info
5252
ROOT_PATH = log
5353

5454
[security]
55-
INSTALL_LOCK = true
56-
SECRET_KEY = 9pCviYTWSb
55+
INSTALL_LOCK = true
56+
SECRET_KEY = 9pCviYTWSb
57+
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0OTI3OTU5ODN9.OQkH5UmzID2XBdwQ9TAI6Jj2t1X-wElVTjbE7aoN4I8
58+

integrations/view_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"testing"
1010

1111
"code.gitea.io/gitea/models"
12+
1213
"github.com/stretchr/testify/assert"
1314
)
1415

modules/router/router.go renamed to routers/routes/routes.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package router
5+
package routes
66

77
import (
88
"os"
@@ -17,15 +17,15 @@ import (
1717
"code.gitea.io/gitea/modules/public"
1818
"code.gitea.io/gitea/modules/setting"
1919
"code.gitea.io/gitea/modules/templates"
20+
"code.gitea.io/gitea/modules/validation"
2021
"code.gitea.io/gitea/routers"
2122
"code.gitea.io/gitea/routers/admin"
2223
apiv1 "code.gitea.io/gitea/routers/api/v1"
2324
"code.gitea.io/gitea/routers/dev"
2425
"code.gitea.io/gitea/routers/org"
26+
"code.gitea.io/gitea/routers/private"
2527
"code.gitea.io/gitea/routers/repo"
2628
"code.gitea.io/gitea/routers/user"
27-
"code.gitea.io/gitea/routers/private"
28-
"code.gitea.io/gitea/modules/validation"
2929

3030
"github.com/go-macaron/binding"
3131
"github.com/go-macaron/cache"
@@ -126,7 +126,7 @@ func NewMacaron() *macaron.Macaron {
126126
return m
127127
}
128128

129-
// RegisterRoutes register routes to Macaron
129+
// RegisterRoutes routes routes to Macaron
130130
func RegisterRoutes(m *macaron.Macaron) {
131131
reqSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: true})
132132
ignSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: setting.Service.RequireSignInView})
@@ -170,7 +170,7 @@ func RegisterRoutes(m *macaron.Macaron) {
170170
m.Combo("/connect").
171171
Get(user.ConnectOpenID).
172172
Post(bindIgnErr(auth.ConnectOpenIDForm{}), user.ConnectOpenIDPost)
173-
m.Combo("/register").
173+
m.Combo("/routes").
174174
Get(user.RegisterOpenID).
175175
Post(bindIgnErr(auth.SignUpOpenIDForm{}), user.RegisterOpenIDPost)
176176
})

0 commit comments

Comments
 (0)