@memberjunction/server 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.ts +8 -7
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { setupSQLServerClient, SQLServerProviderConfigData } from '@memberjuncti
|
|
|
9
9
|
import { json } from 'body-parser';
|
|
10
10
|
import cors from 'cors';
|
|
11
11
|
import express from 'express';
|
|
12
|
-
import { globSync } from 'fast-glob';
|
|
12
|
+
import { convertPathToPattern, globSync } from 'fast-glob';
|
|
13
13
|
import { useServer } from 'graphql-ws/lib/use/ws';
|
|
14
14
|
import { createServer } from 'node:http';
|
|
15
15
|
import 'reflect-metadata';
|
|
@@ -25,12 +25,12 @@ import orm from './orm';
|
|
|
25
25
|
|
|
26
26
|
const cacheRefreshInterval = configInfo.databaseSettings.metadataCacheRefreshInterval;
|
|
27
27
|
|
|
28
|
-
export { configInfo } from './config';
|
|
29
|
-
export { NewUserBase } from './auth/newUsers';
|
|
30
28
|
export { MaxLength } from 'class-validator';
|
|
31
|
-
export * from './types';
|
|
32
|
-
export * from './directives';
|
|
33
29
|
export * from 'type-graphql';
|
|
30
|
+
export { NewUserBase } from './auth/newUsers';
|
|
31
|
+
export { configInfo } from './config';
|
|
32
|
+
export * from './directives';
|
|
33
|
+
export * from './types';
|
|
34
34
|
|
|
35
35
|
export const serve = async (resolverPaths: Array<string>) => {
|
|
36
36
|
const dataSource = new DataSource(orm);
|
|
@@ -48,8 +48,9 @@ export const serve = async (resolverPaths: Array<string>) => {
|
|
|
48
48
|
.catch((err) => {
|
|
49
49
|
console.error('Error during Data Source initialization', err);
|
|
50
50
|
});
|
|
51
|
-
|
|
52
|
-
const paths = resolverPaths.flatMap((path) => globSync(path));
|
|
51
|
+
|
|
52
|
+
const paths = resolverPaths.flatMap((path) => globSync(convertPathToPattern(path)));
|
|
53
|
+
console.log({ resolverPaths, paths });
|
|
53
54
|
const dynamicModules = await Promise.all(paths.map((modulePath) => import(modulePath.replace(/\.[jt]s$/, ''))));
|
|
54
55
|
const resolvers = dynamicModules.flatMap((module) =>
|
|
55
56
|
Object.values(module).filter((value) => typeof value === 'function')
|