Skip to content

Commit 13ba9bb

Browse files
committed
replace leftover /gm routes with /host
1 parent 2914f3e commit 13ba9bb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

backend/cmd/server/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ Visit http://localhost:8080 after starting the server.
112112
io := sock.Mount(r)
113113
defer io.Close()
114114

115-
// GM-protected route (serves the SPA index behind basic auth)
115+
// Host-protected routes (serves the SPA index behind basic auth)
116116
if cfg.GMUser != "" && cfg.GMPass != "" {
117117
auth := gin.BasicAuth(gin.Accounts{cfg.GMUser: cfg.GMPass})
118-
r.GET("/gm", auth, func(c *gin.Context) {
118+
r.GET("/host", auth, func(c *gin.Context) {
119119
staticserver.Handler().ServeHTTP(c.Writer, c.Request)
120120
})
121-
r.GET("/gm/*any", auth, func(c *gin.Context) {
121+
r.GET("/host/*any", auth, func(c *gin.Context) {
122122
staticserver.Handler().ServeHTTP(c.Writer, c.Request)
123123
})
124124
}
@@ -134,7 +134,7 @@ Visit http://localhost:8080 after starting the server.
134134
if cfg.GMUser != "" && cfg.GMPass != "" {
135135
auth := gin.BasicAuth(gin.Accounts{cfg.GMUser: cfg.GMPass})
136136
type createReq struct{ Config game.SessionConfig `json:"config"` }
137-
r.POST("/api/gm/create", auth, func(c *gin.Context) {
137+
r.POST("/api/host/create", auth, func(c *gin.Context) {
138138
var req createReq
139139
if err := c.BindJSON(&req); err != nil {
140140
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid_config"})

frontend/src/pages/Host.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default function Host() {
9898
}, [phase]);
9999

100100
const onCreate = async () => {
101-
const res = await fetch("/api/gm/create", {
101+
const res = await fetch("/api/host/create", {
102102
method: "POST",
103103
headers: { "Content-Type": "application/json" },
104104
body: JSON.stringify({

0 commit comments

Comments
 (0)