Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
feat: redirect to docs when hitting main api endpoint (#2426)
tomf9fbe4fc4014
diff --git a/apps/api/src/__tests__/e2e_full_withAuth/index.test.ts b/apps/api/src/__tests__/e2e_full_withAuth/index.test.tsindex 453875b9d..a7486fad1 100644--- a/apps/api/src/__tests__/e2e_full_withAuth/index.test.ts+++ b/apps/api/src/__tests__/e2e_full_withAuth/index.test.ts@@ -16,20 +16,12 @@ describe("E2E Tests for API Routes", () => {afterAll(() => {delete process.env.USE_DB_AUTHENTICATION;});- describe("GET /", () => {- it.concurrent("should return Hello, world! message", async () => {- const response = await request(TEST_URL).get("/");+ describe("GET /e2e-test", () => {+ it.concurrent("should return OK message", async () => {+ const response = await request(TEST_URL).get("/e2e-test");expect(response.statusCode).toBe(200);- expect(response.text).toContain("SCRAPERS-JS: Hello, world! Fly.io");- });- });-- describe("GET /test", () => {- it.concurrent("should return Hello, world! message", async () => {- const response = await request(TEST_URL).get("/test");- expect(response.statusCode).toBe(200);- expect(response.text).toContain("Hello, world!");+ expect(response.text).toContain("OK");});});diff --git a/apps/api/src/__tests__/e2e_noAuth/index.test.ts b/apps/api/src/__tests__/e2e_noAuth/index.test.tsindex 57f7b4cf8..722c1a60d 100644--- a/apps/api/src/__tests__/e2e_noAuth/index.test.ts+++ b/apps/api/src/__tests__/e2e_noAuth/index.test.ts@@ -32,19 +32,11 @@ describe("E2E Tests for API Routes with No Authentication", () => {process.env = originalEnv;});- describe("GET /", () => {- it("should return Hello, world! message", async () => {- const response = await request(TEST_URL).get("/");+ describe("GET /e2e-test", () => {+ it.concurrent("should return OK message", async () => {+ const response = await request(TEST_URL).get("/e2e-test");expect(response.statusCode).toBe(200);- expect(response.text).toContain("SCRAPERS-JS: Hello, world! Fly.io");- });- });-- describe("GET /test", () => {- it("should return Hello, world! message", async () => {- const response = await request(TEST_URL).get("/test");- expect(response.statusCode).toBe(200);- expect(response.text).toContain("Hello, world!");+ expect(response.text).toContain("OK");});});diff --git a/apps/api/src/index.ts b/apps/api/src/index.tsindex ff5366612..c5217ceeb 100644--- a/apps/api/src/index.ts+++ b/apps/api/src/index.ts@@ -89,13 +89,12 @@ app.use(serverAdapter.getRouter(),);-app.get("/", (req, res) => {- res.send("SCRAPERS-JS: Hello, world! K8s!");+app.get("/", (_, res) => {+ res.redirect("https://docs.firecrawl.dev/api-reference/v2-introduction");});-//write a simple test function-app.get("/test", async (req, res) => {- res.send("Hello, world!");+app.get("/e2e-test", (_, res) => {+ res.status(200).send("OK");});// register router