include-routes.go (1537B)
1 package main 2 3 import ( 4 "net/http" 5 ) 6 7 // RegisterRoutes sets up all HTTP routes for the application 8 func RegisterRoutes() { 9 // Page handlers 10 http.HandleFunc("/", listFilesHandler) 11 http.HandleFunc("/add", uploadHandler) 12 http.HandleFunc("/add-yt", ytdlpHandler) 13 http.HandleFunc("/add-local", localFileHandler) 14 http.HandleFunc("/admin", adminHandler) 15 http.HandleFunc("/bulk-tag", bulkTagHandler) 16 http.HandleFunc("/cbz/", cbzViewerHandler) 17 http.HandleFunc("/file/", fileRouter) 18 http.HandleFunc("/notes", notesViewHandler) 19 http.HandleFunc("/notes/apply-sed", notesApplySedHandler) 20 http.HandleFunc("/notes/export", notesExportHandler) 21 http.HandleFunc("/notes/filter", notesFilterHandler) 22 http.HandleFunc("/notes/import", notesImportHandler) 23 http.HandleFunc("/notes/preview", notesPreviewHandler) 24 http.HandleFunc("/notes/save", notesSaveHandler) 25 http.HandleFunc("/notes/stats", notesStatsHandler) 26 http.HandleFunc("/properties", propertiesIndexHandler) 27 http.HandleFunc("/property/", propertyFilterHandler) 28 http.HandleFunc("/search/", searchHandler) 29 http.HandleFunc("/tag/", tagFilterHandler) 30 http.HandleFunc("/tags", tagsHandler) 31 http.HandleFunc("/thumbnails/generate", generateThumbnailHandler) 32 http.HandleFunc("/untagged", untaggedFilesHandler) 33 http.HandleFunc("/upload-url", uploadFromURLHandler) 34 // Static file serving 35 http.Handle("/uploads/", http.StripPrefix("/uploads/", http.FileServer(http.Dir(config.UploadDir)))) 36 http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static")))) 37 }