mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-05 08:10:39 +08:00
Nick: moved away from axios
This commit is contained in:
parent
f155449458
commit
d62f12c9d9
@ -1,4 +1,3 @@
|
|||||||
import axios from "axios";
|
|
||||||
import dotenv from "dotenv";
|
import dotenv from "dotenv";
|
||||||
import { SearchResult } from "../../src/lib/entities";
|
import { SearchResult } from "../../src/lib/entities";
|
||||||
import * as Sentry from "@sentry/node";
|
import * as Sentry from "@sentry/node";
|
||||||
@ -37,18 +36,18 @@ export async function fireEngineMap(
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
let config = {
|
const response = await fetch(`${process.env.FIRE_ENGINE_BETA_URL}/search`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: `${process.env.FIRE_ENGINE_BETA_URL}/search`,
|
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"X-Disable-Cache": "true"
|
"X-Disable-Cache": "true"
|
||||||
},
|
},
|
||||||
data: data,
|
body: data
|
||||||
};
|
});
|
||||||
const response = await axios(config);
|
|
||||||
if (response && response.data) {
|
if (response.ok) {
|
||||||
return response.data;
|
const responseData = await response.json();
|
||||||
|
return responseData;
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user