diff --git a/pages/docs/dev-server.mdx b/pages/docs/dev-server.mdx index 2a7ef0483..a7ccf226a 100644 --- a/pages/docs/dev-server.mdx +++ b/pages/docs/dev-server.mdx @@ -9,7 +9,7 @@ The Inngest dev server is an [open source](https://github.com/inngest/inngest) e ![Dev Server Demo](/assets/docs/local-development/dev-server-demo-2025-01-15.gif) -You can start the dev server with a single command. The dev server will attempt to find an Inngest `serve` API endpoint by scanning ports and endpoints that are commonly used for this purpose. (See the [list of ports](https://github.com/inngest/inngest/blob/ea67219e7e7c33451416249f98fd5ca48e99ba28/pkg/devserver/discovery.go#L15-L28) the dev server scans.) Alternatively, you can specify the URL of the `serve` endpoint: +You can start the dev server with a single command. The dev server will attempt to find an Inngest `serve` API endpoint by scanning ports and endpoints that are commonly used for this purpose (See "[Auto-discovery](#auto-discovery)"). Alternatively, you can specify the URL of the `serve` endpoint: ```shell {{ title: "npx (npm)" }} @@ -37,7 +37,7 @@ There are two ways to connect apps to the Dev Server: ![Dev Server demo manually syncing an app](/assets/docs/local-development/dev-server-apps-demo-2025-01-15.gif) - The dev server does "auto-discovery" which scans popular ports and [endpoints](https://github.com/inngest/inngest/blob/ea67219e7e7c33451416249f98fd5ca48e99ba28/pkg/devserver/discovery.go#L32-L40) like `/api/inngest` and `/.netlify/functions/inngest`. **If you would like to disable auto-discovery, pass the `--no-discovery` flag to the `dev` command**. + The dev server does "auto-discovery" which scans popular ports and endpoints like `/api/inngest` and `/.netlify/functions/inngest`. **If you would like to disable auto-discovery, pass the `--no-discovery` flag to the `dev` command**. Learn more about [this below](#auto-discovery) ### How functions are loaded by the Dev Server @@ -180,3 +180,37 @@ $ curl -s http://localhost:3000/api/inngest | jq "functionsFound": 1 } ``` + +## Auto-discovery + +The dev server will automatically detect and connect to apps running on common ports and endpoints. You can disable auto-discovery by passing the `--no-discovery` flag to the `dev` command: + +```sh +npx inngest-cli@latest dev --no-discovery -u http://localhost:3000/api/inngest +``` + + +```plaintext {{ title: "Common endpoints" }} +/api/inngest +/x/inngest +/.netlify/functions/inngest +/.redwood/functions/inngest +``` + +```plaintext {{ title: "Common ports" }} +80, 443, +// Rails, Express & Next/Nuxt/Nest routes +3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, +// Django +5000, +// Vite/SvelteKit +5173, +// Other common ports +8000, 8080, 8081, 8888, +// Redwood +8910, 8911, 8912, 8913, 8914, 8915, +// Cloudflare Workers +8787, +``` + + diff --git a/pages/docs/faq.mdx b/pages/docs/faq.mdx index 818ea60c3..33d1a3f4a 100644 --- a/pages/docs/faq.mdx +++ b/pages/docs/faq.mdx @@ -12,7 +12,7 @@ - [Why am I getting a `NON_DETERMINISTIC_FUNCTION` error?](#why-am-i-getting-a-non-deterministic-function-error) - [Why am I getting an `Illegal invocation` error?](#why-am-i-getting-an-illegal-invocation-error) - +- [Why is the dev server polling endpoints that don't exist?](#why-is-the-dev-server-polling-endpoints-that-don-t-exist) ## How do I run crons only in production? There are multiple ways to achieve it: @@ -96,3 +96,14 @@ new Inngest({ fetch: fetch.bind(globalThis), }); ``` + +## Why is the dev server polling endpoints that don't exist? +The dev server will automatically detect and connect to apps running on common ports and endpoints. These endpoints include `/api/inngest`, `/x/inngest`, `/.netlify/functions/inngest`, `/.redwood/functions/inngest`. + +You can disable auto-discovery by passing the `--no-discovery` flag to the `dev` command: + +```sh +npx inngest-cli@latest dev --no-discovery +``` + +Learn more about this in the [dev server](/docs/dev-server#auto-discovery) docs. \ No newline at end of file