Skip to content

Commit e770aaa

Browse files
committed
throw if EndpointsRouterModule is not configured
1 parent 2a37380 commit e770aaa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/nestjs-endpoints/src/helpers.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ const shortCircuitDirs: Record<string, boolean> = {
1717
[process.cwd()]: true,
1818
};
1919
export function getEndpointHttpPath(_callsites: callsites.CallSite[]) {
20-
if (settings.rootDirectory) {
21-
shortCircuitDirs[settings.rootDirectory] = true;
20+
if (!settings.rootDirectory) {
21+
throw new Error(
22+
'nestjs-endpoints root directory not set. Did you configure EndpointsRouterModule?',
23+
);
2224
}
25+
shortCircuitDirs[settings.rootDirectory] = true;
2326
const file = _callsites
2427
.map((callsite) => {
2528
const fileName = callsite.getFileName();

0 commit comments

Comments
 (0)