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
Make worker Express server port configurable via environment variable (#1748)
devin-ai-integration[bot]b28d4f72f874
diff --git a/.github/workflows/test-server-self-host.yml b/.github/workflows/test-server-self-host.ymlindex 6209f2369..aff1167a7 100644--- a/.github/workflows/test-server-self-host.yml+++ b/.github/workflows/test-server-self-host.yml@@ -6,9 +6,7 @@ on:- mainenv:- PORT: 3002REDIS_URL: redis://localhost:6379- HOST: 0.0.0.0ENV: ${{ secrets.ENV }}TEST_SUITE_SELF_HOSTED: trueUSE_GO_MARKDOWN_PARSER: true@@ -100,9 +98,15 @@ jobs:working-directory: ./- name: Start serverrun: npm run start:production > api.log 2>&1 &+ env:+ PORT: 3002+ HOST: 0.0.0.0working-directory: ./apps/api- name: Start workerrun: npm run workers > worker.log 2>&1 &+ env:+ PORT: 3005+ HOST: 0.0.0.0working-directory: ./apps/api- name: Start playwrightif: matrix.engine == 'playwright'diff --git a/.github/workflows/test-server.yml b/.github/workflows/test-server.ymlindex df25b00e1..c30056257 100644--- a/.github/workflows/test-server.yml+++ b/.github/workflows/test-server.yml@@ -7,11 +7,9 @@ on:env:BULL_AUTH_KEY: ${{ secrets.BULL_AUTH_KEY }}- HOST: ${{ secrets.HOST }}POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }}OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}- PORT: ${{ secrets.PORT }}REDIS_URL: ${{ secrets.REDIS_URL }}SUPABASE_ANON_TOKEN: ${{ secrets.SUPABASE_ANON_TOKEN }}SUPABASE_SERVICE_TOKEN: ${{ secrets.SUPABASE_SERVICE_TOKEN }}@@ -101,10 +99,16 @@ jobs:working-directory: ./apps/api/sharedLibs/pdf-parser- name: Start the applicationrun: npm run start:production > api.log 2>&1 &+ env:+ PORT: 3002+ HOST: 0.0.0.0working-directory: ./apps/apiid: start_app- name: Start workerrun: npm run workers > worker.log 2>&1 &+ env:+ PORT: 3005+ HOST: 0.0.0.0working-directory: ./apps/apiid: start_workers- name: Start index workerdiff --git a/SELF_HOST.md b/SELF_HOST.mdindex a716688f6..dd61faf7f 100644--- a/SELF_HOST.md+++ b/SELF_HOST.md@@ -42,6 +42,8 @@ Create an `.env` in the root directory using the template below.PORT=3002HOST=0.0.0.0+# Note: PORT is used by both the main API server and worker liveness check endpoint+# To turn on DB authentication, you need to set up Supabase.USE_DB_AUTHENTICATION=falsediff --git a/apps/api/src/services/queue-worker.ts b/apps/api/src/services/queue-worker.tsindex 57eb1c0a9..f59640c72 100644--- a/apps/api/src/services/queue-worker.ts+++ b/apps/api/src/services/queue-worker.ts@@ -1620,8 +1620,9 @@ app.get("/liveness", (req, res) => {}});-app.listen(3005, () => {- _logger.info("Liveness endpoint is running on port 3005");+const workerPort = process.env.PORT || 3005;+app.listen(workerPort, () => {+ _logger.info(`Liveness endpoint is running on port ${workerPort}`);});(async () => {