roster-server 1.6.6 → 1.7.0
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/index.js +10 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -24,7 +24,7 @@ class Roster {
|
|
|
24
24
|
this.loadSites();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
loadSites() {
|
|
28
28
|
// Check if wwwPath exists
|
|
29
29
|
if (!fs.existsSync(this.wwwPath)) {
|
|
30
30
|
console.warn(`⚠️ WWW path does not exist: ${this.wwwPath}`);
|
|
@@ -44,9 +44,15 @@ class Roster {
|
|
|
44
44
|
for (const indexFile of possibleIndexFiles) {
|
|
45
45
|
const indexPath = path.join(domainPath, indexFile);
|
|
46
46
|
if (fs.existsSync(indexPath)) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
try {
|
|
48
|
+
siteApp = await import(indexPath);
|
|
49
|
+
siteApp = siteApp.default || siteApp;
|
|
50
|
+
loadedFile = indexFile;
|
|
51
|
+
break;
|
|
52
|
+
} catch (err) {
|
|
53
|
+
console.warn(`⚠️ Error loading ${indexPath}:`, err.message);
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
58
|
|