feat(amp): add root-level /threads routes for CLI compatibility

This commit is contained in:
hkfires
2025-12-05 10:46:01 +08:00
parent 89d68962b1
commit acdfb3bceb
2 changed files with 2 additions and 0 deletions

View File

@@ -128,6 +128,7 @@ func (m *AmpModule) registerManagementRoutes(engine *gin.Engine, baseHandler *ha
// Root-level routes that AMP CLI expects without /api prefix
// These need the same security middleware as the /api/* routes (dynamic for hot-reload)
rootMiddleware := []gin.HandlerFunc{noCORSMiddleware(), m.localhostOnlyMiddleware()}
engine.GET("/threads/*path", append(rootMiddleware, proxyHandler)...)
engine.GET("/threads.rss", append(rootMiddleware, proxyHandler)...)
// Root-level auth routes for CLI login flow