Skip to content

Commit

Permalink
Generate routes with Promise.all
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x committed Sep 22, 2023
1 parent c30c4ec commit 6e622fe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion generate-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,9 @@ const write = async (data: string, ...path: string[]): Promise<void> => {
}

const routeRootPath = resolve('src', 'lib', 'seam', 'connect', 'routes')
const writeRoute = async (route: Route): Promise<void> =>
{ await write(renderRoute(route), routeRootPath, `${route.namespace}.ts`); }

await write(renderRoute(exampleRoute), routeRootPath, 'workspaces.ts')
const routes = [exampleRoute]

await Promise.all(routes.map(writeRoute))

0 comments on commit 6e622fe

Please sign in to comment.