@@ -11,6 +11,7 @@ import { rateLimiter } from "./middleware/rate-limit.js";
1111import {
1212 handleAddItem ,
1313 handleAtom ,
14+ handleClearItems ,
1415 handleCreateFeed ,
1516 handleGetConfig ,
1617 handleGetItems ,
@@ -82,6 +83,10 @@ feedRoutes.get("/:feedId/rss.xml", handleRss);
8283feedRoutes . get ( "/:feedId/atom.xml" , handleAtom ) ;
8384feedRoutes . get ( "/:feedId/feed.json" , handleJsonFeed ) ;
8485feedRoutes . get ( "/:feedId/raw.json" , handleRawJson ) ;
86+ feedRoutes . get ( "/:feedId" , ( c ) => {
87+ const feedId = c . req . param ( "feedId" ) ;
88+ return c . redirect ( `/${ feedId } /feed.json` , 301 ) ;
89+ } ) ;
8590
8691// Protected API routes (authentication required)
8792const protectedRoutes = new Hono ( ) ;
@@ -91,6 +96,7 @@ protectedRoutes.get("/api/feeds/:feedId/config", handleGetConfig);
9196protectedRoutes . put ( "/api/feeds/:feedId/config" , handleUpdateConfig ) ;
9297protectedRoutes . get ( "/api/feeds/:feedId/items" , handleGetItems ) ;
9398protectedRoutes . post ( "/api/feeds/:feedId/items" , handleAddItem ) ;
99+ protectedRoutes . delete ( "/api/feeds/:feedId/items" , handleClearItems ) ;
94100
95101app . route ( "/" , publicRoutes ) ;
96102app . route ( "/" , feedRoutes ) ;
0 commit comments