From 3dee1aed9e623f47a3fd61b92fa8faf6f154b573 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Tue, 3 Jan 2023 21:44:03 -0300 Subject: [PATCH] Create /config/data/default API endpoint to serve default khoj config This can ease configuring khoj from the different interfaces - Don't need to know all the (default) config used by khoj. - Just get default config by calling the above API endpoint. - Then modify desired portions and call POST /api/config/data to configure khoj. --- src/routers/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/routers/api.py b/src/routers/api.py index 21decb3f..b78de882 100644 --- a/src/routers/api.py +++ b/src/routers/api.py @@ -21,6 +21,10 @@ logger = logging.getLogger(__name__) # Create Routes +@api.get('/config/data/default') +def get_default_config_data(): + return constants.default_config + @api.get('/config/data', response_model=FullConfig) def get_config_data(): return state.config