Changed from
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 35s
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 35s
This commit is contained in:
parent
184ac9247d
commit
ed4c8b28da
1 changed files with 6 additions and 1 deletions
|
|
@ -87,7 +87,12 @@ export class Router {
|
|||
}
|
||||
|
||||
// Load the file as a module
|
||||
const controllerModule = require(controllerPath);
|
||||
const moduleNamespace = await import(controllerPath);
|
||||
|
||||
// When you import() a file, you get a "Module Namespace Object".
|
||||
// If the file used 'module.exports = Class' or 'export default Class',
|
||||
// your class is now inside the '.default' property.
|
||||
const controllerModule = moduleNamespace.default || moduleNamespace;
|
||||
|
||||
logMessage(`${controllerPath} loaded successfully: ${JSON.stringify(Object.keys(controllerModule))} exports found.`, LogLevel.DEBUG);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue