diff --git a/src/interface/desktop/main.js b/src/interface/desktop/main.js index 4f8891cf..83a19f36 100644 --- a/src/interface/desktop/main.js +++ b/src/interface/desktop/main.js @@ -169,7 +169,7 @@ function pushDataToKhoj (regenerate = false) { const hostURL = store.get('hostURL') || KHOJ_URL; - axios.post(`${hostURL}/v1/indexer/batch?regenerate=${regenerate}`, stream, { headers }) + axios.post(`${hostURL}/api/v1/indexer/batch?regenerate=${regenerate}`, stream, { headers }) .then(response => { console.log(response.data); const win = BrowserWindow.getAllWindows()[0]; diff --git a/src/khoj/configure.py b/src/khoj/configure.py index 7e6cc409..c978735e 100644 --- a/src/khoj/configure.py +++ b/src/khoj/configure.py @@ -103,7 +103,7 @@ def configure_routes(app): app.mount("/static", StaticFiles(directory=constants.web_directory), name="static") app.include_router(api, prefix="/api") app.include_router(api_beta, prefix="/api/beta") - app.include_router(indexer, prefix="/v1/indexer") + app.include_router(indexer, prefix="/api/v1/indexer") app.include_router(web_client) diff --git a/tests/test_client.py b/tests/test_client.py index d2497f73..40a032f7 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -66,7 +66,7 @@ def test_index_batch(client): headers = {"x-api-key": "secret"} # Act - response = client.post("/v1/indexer/batch", json=request_body, headers=headers) + response = client.post("/api/v1/indexer/batch", json=request_body, headers=headers) # Assert assert response.status_code == 200 @@ -81,7 +81,7 @@ def test_regenerate_with_valid_content_type(client): headers = {"x-api-key": "secret"} # Act - response = client.post(f"/v1/indexer/batch?search_type={content_type}", json=request_body, headers=headers) + response = client.post(f"/api/v1/indexer/batch?search_type={content_type}", json=request_body, headers=headers) # Assert assert response.status_code == 200, f"Returned status: {response.status_code} for content type: {content_type}" @@ -97,7 +97,7 @@ def test_regenerate_with_github_fails_without_pat(client): headers = {"x-api-key": "secret"} # Act - response = client.post(f"/v1/indexer/batch?search_type=github", json=request_body, headers=headers) + response = client.post(f"/api/v1/indexer/batch?search_type=github", json=request_body, headers=headers) # Assert assert response.status_code == 200, f"Returned status: {response.status_code} for content type: github"