返回 CodeWhale
route.ts
根目录 / telemetry-ingest / src / route.ts
1 /**
2 * The one route.
3 *
4 * This lives in its own module rather than next to the handler because the
5 * Workers runtime treats **every named export of the entrypoint module** as an
6 * entrypoint: exporting a plain string from `src/index.ts` fails the worker at
7 * startup with "Incorrect type for map entry: the provided value is not of type
8 * 'function or ExportedHandler'". `src/index.ts` therefore has exactly one
9 * export, the default handler, and every shared value the tests need lives
10 * somewhere else.
11 */
12
13 /** The only path this service answers. Every other path is 404. */
14 export const INGEST_PATH = "/v1/telemetry";
15
15 lines TYPESCRIPT