Skip to content

Commit b2ab151

Browse files
committed
golang > python
1 parent d0c1968 commit b2ab151

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

cmd/server/main.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,34 @@ func main() {
3030
if err := s.Install(); err != nil {
3131
log.Printf("⚠️ SteamCMD installation warning: %v", err)
3232
}
33+
}
3334

34-
router := gin.Default()
35+
router := gin.Default()
3536

36-
h := handler.New(s)
37-
defer h.Cleanup()
37+
h := handler.New(s)
38+
defer h.Cleanup()
3839

39-
router.GET("/", func(c *gin.Context) {
40-
c.Redirect(http.StatusMovedPermanently, "/workshop/")
41-
})
40+
router.GET("/", func(c *gin.Context) {
41+
c.Redirect(http.StatusMovedPermanently, "/workshop/")
42+
})
4243

43-
router.GET("/api/workshop/:app_id/:workshop_id", h.DownloadWorkshopHandler)
44-
router.GET("/api/collection/:app_id/:collection_id", h.DownloadCollectionHandler)
44+
router.GET("/api/workshop/:app_id/:workshop_id", h.DownloadWorkshopHandler)
45+
router.GET("/api/collection/:app_id/:collection_id", h.DownloadCollectionHandler)
4546

46-
router.Any("/workshop/*path", h.SteamProxyHandler)
47-
router.Any("/app/*path", h.SteamProxyHandler)
48-
router.Any("/sharedfiles/*path", h.SteamProxyHandler)
47+
router.Any("/workshop/*path", h.SteamProxyHandler)
48+
router.Any("/app/*path", h.SteamProxyHandler)
49+
router.Any("/sharedfiles/*path", h.SteamProxyHandler)
4950

50-
unsupportedRoutes := []string{
51-
"/login/home/", "/market/", "/discussions/", "/my/",
52-
"/id/", "/account/", "/profiles/",
53-
}
54-
for _, route := range unsupportedRoutes {
55-
router.GET(route, h.UnsupportedPageHandler)
56-
}
51+
unsupportedRoutes := []string{
52+
"/login/home/", "/market/", "/discussions/", "/my/",
53+
"/id/", "/account/", "/profiles/",
54+
}
55+
for _, route := range unsupportedRoutes {
56+
router.GET(route, h.UnsupportedPageHandler)
57+
}
5758

58-
log.Printf("🚀 Server starting on http://0.0.0.0:%s", *port)
59-
if err := router.Run(":" + *port); err != nil {
60-
log.Fatalf("❌ Failed to start server: %v", err)
61-
}
59+
log.Printf("🚀 Server starting on http://0.0.0.0:%s", *port)
60+
if err := router.Run(":" + *port); err != nil {
61+
log.Fatalf("❌ Failed to start server: %v", err)
6262
}
6363
}

0 commit comments

Comments
 (0)