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.
This commit is contained in:
Debanjum Singh Solanky
2023-01-03 21:44:03 -03:00
parent ce945f7a90
commit 3dee1aed9e

View File

@@ -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