This commit is contained in:
Nicolas 2024-09-11 14:59:40 -04:00
commit e19dc68718
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ import { describe, test, expect } from '@jest/globals';
dotenv.config();
const TEST_API_KEY = process.env.TEST_API_KEY;
const API_URL = "https://api.firecrawl.dev";
const API_URL = process.env.API_URL ?? "https://api.firecrawl.dev";
describe('FirecrawlApp E2E Tests', () => {
test.concurrent('should throw error for no API key', async () => {

View File

@ -186,7 +186,7 @@ export default class FirecrawlApp {
if (typeof apiKey !== "string") {
throw new Error("No API key provided");
}
this.apiKey = apiKey;
this.apiUrl = apiUrl || "https://api.firecrawl.dev";
}
@ -346,9 +346,9 @@ export default class FirecrawlApp {
`${this.apiUrl}/v1/crawl/${id}`,
headers
);
if (response.status === 200 && getAllData) {
if (response.status === 200) {
let allData = response.data.data;
if (response.data.status === "completed") {
if (getAllData && response.data.status === "completed") {
let statusData = response.data
if ("data" in statusData) {
let data = statusData.data;