diff --git a/README.md b/README.md index 9374a2f..0683714 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Open [http://localhost:3000](http://localhost:3000) in your browser. For the recommended custom server with WebSocket support and `/metrics`, run: ```bash -npm run dev:ws +npm run dev:decoupled ``` `dev:ws` starts the decoupled microservices web server. Start the indexer in a @@ -130,7 +130,7 @@ npm run format # Format code with Prettier ## Telemetry -The custom server exposes Prometheus metrics on `http://localhost:3000/metrics` when running `npm run dev:ws`. +The custom server exposes Prometheus metrics on `http://localhost:3000/metrics` when running `npm run dev:decoupled`. You can configure OpenTelemetry to export spans to Jaeger by setting: diff --git a/server.ts b/server.ts index a1dc688..15fd0e4 100644 --- a/server.ts +++ b/server.ts @@ -36,6 +36,12 @@ * Run with: npx ts-node --project tsconfig.server.json server.ts --legacy * (or via the `dev:ws:legacy` npm script) */ + +// Visible runtime deprecation warning for developers running the legacy server. +// This should make it obvious when someone accidentally starts the deprecated +// monolithic server. The process continues to run for compatibility, but the +// warning recommends the decoupled microservices path. +console.warn("\n\u001b[33mDEPRECATION: \`server.ts\` is a legacy monolithic server with a known CPU-starvation flaw.\nRecommended: use the microservices/decoupled path (npm run dev:decoupled).\nTo run the legacy server anyway, use the explicit script: npm run dev:legacy\u001b[0m\n"); import { createServer, IncomingMessage } from "http"; import { parse } from "url"; import next from "next";