|
|
@@ -132,10 +132,12 @@ func Serve(router *mux.Router, store *storage.Storage, pool *worker.Pool) {
|
|
|
uiRouter.HandleFunc("/sessions/{sessionID}/remove", handler.removeSession).Name("removeSession").Methods(http.MethodPost)
|
|
|
|
|
|
// API Keys pages.
|
|
|
- uiRouter.HandleFunc("/keys", handler.showAPIKeysPage).Name("apiKeys").Methods(http.MethodGet)
|
|
|
- uiRouter.HandleFunc("/keys/{keyID}/delete", handler.deleteAPIKey).Name("deleteAPIKey").Methods(http.MethodPost)
|
|
|
- uiRouter.HandleFunc("/keys/create", handler.showCreateAPIKeyPage).Name("createAPIKey").Methods(http.MethodGet)
|
|
|
- uiRouter.HandleFunc("/keys/save", handler.saveAPIKey).Name("saveAPIKey").Methods(http.MethodPost)
|
|
|
+ if config.Opts.HasAPI() {
|
|
|
+ uiRouter.HandleFunc("/keys", handler.showAPIKeysPage).Name("apiKeys").Methods(http.MethodGet)
|
|
|
+ uiRouter.HandleFunc("/keys/{keyID}/delete", handler.deleteAPIKey).Name("deleteAPIKey").Methods(http.MethodPost)
|
|
|
+ uiRouter.HandleFunc("/keys/create", handler.showCreateAPIKeyPage).Name("createAPIKey").Methods(http.MethodGet)
|
|
|
+ uiRouter.HandleFunc("/keys/save", handler.saveAPIKey).Name("saveAPIKey").Methods(http.MethodPost)
|
|
|
+ }
|
|
|
|
|
|
// OPML pages.
|
|
|
uiRouter.HandleFunc("/export", handler.exportFeeds).Name("export").Methods(http.MethodGet)
|