Skip to content

Commit

Permalink
fixup! Add support for routing to multiple Workers
Browse files Browse the repository at this point in the history
Assert names unique when collecting routes
  • Loading branch information
mrbbot committed Mar 7, 2023
1 parent 839b02c commit f095aad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/tre/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ function getWorkerRoutes(
const allRoutes = new Map<string, string[]>();
for (const workerOpts of allWorkerOpts) {
if (workerOpts.core.routes !== undefined) {
allRoutes.set(workerOpts.core.name ?? "", workerOpts.core.routes);
const name = workerOpts.core.name ?? "";
assert(!allRoutes.has(name));
allRoutes.set(name, workerOpts.core.routes);
}
}
return allRoutes;
Expand Down

0 comments on commit f095aad

Please sign in to comment.