cognee/examples/node/fetch.js
Boris 2f832b190c
fix: various fixes for the deployment
* fix: remove groups from UserRead model

* fix: add missing system dependencies for postgres

* fix: change vector db provider environment variable name

* fix: WeaviateAdapter retrieve bug

* fix: correctly return data point objects from retrieve method

* fix: align graph object properties

* feat: add node example
2024-10-22 11:26:48 +02:00

14 lines
384 B
JavaScript

import nodeFetch from 'node-fetch';
import handleServerErrors from './handleServerErrors.js';
export default function fetch(url, options = {}, token) {
return nodeFetch('http://127.0.0.1:8000/api' + url, {
...options,
headers: {
...options.headers,
'Authorization': `Bearer ${token}`,
},
})
.then(handleServerErrors)
.catch(handleServerErrors);
}