|
@@ -243,7 +243,7 @@ class Server {
|
|
|
}
|
|
|
registerRoutes(dir) {
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
- const files = fs_1.default.readdirSync(dir);
|
|
|
+ const files = fs_1.default.readdirSync(dir, { recursive: true, encoding: 'utf8' });
|
|
|
for (const file of files) {
|
|
|
if (/\.js$/.test(file)) {
|
|
|
const { default: RouteClass } = yield Promise.resolve(`${path_1.default.join(dir, file)}`).then(s => __importStar(require(s)));
|
|
@@ -259,7 +259,7 @@ class Server {
|
|
|
}
|
|
|
registerMiddlewares(dir) {
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
- const files = fs_1.default.readdirSync(dir);
|
|
|
+ const files = fs_1.default.readdirSync(dir, { recursive: true, encoding: 'utf8' });
|
|
|
for (const file of files) {
|
|
|
if (/\.js$/.test(file)) {
|
|
|
const { default: MiddlewareClass } = yield Promise.resolve(`${path_1.default.join(dir, file)}`).then(s => __importStar(require(s)));
|