roster-server 1.6.2 → 1.6.6

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.
Files changed (2) hide show
  1. package/index.js +3 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -24,7 +24,7 @@ class Roster {
24
24
  this.loadSites();
25
25
  }
26
26
 
27
- loadSites() {
27
+ async 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}`);
@@ -33,7 +33,7 @@ class Roster {
33
33
 
34
34
  fs.readdirSync(this.wwwPath, { withFileTypes: true })
35
35
  .filter(dirent => dirent.isDirectory())
36
- .forEach((dirent) => {
36
+ .forEach(async (dirent) => {
37
37
  const domain = dirent.name;
38
38
  const domainPath = path.join(this.wwwPath, domain);
39
39
 
@@ -44,7 +44,7 @@ class Roster {
44
44
  for (const indexFile of possibleIndexFiles) {
45
45
  const indexPath = path.join(domainPath, indexFile);
46
46
  if (fs.existsSync(indexPath)) {
47
- siteApp = require(indexPath);
47
+ siteApp = await import(indexPath);
48
48
  loadedFile = indexFile;
49
49
  break;
50
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roster-server",
3
- "version": "1.6.2",
3
+ "version": "1.6.6",
4
4
  "description": "👾 RosterServer - A domain host router to host multiple HTTPS.",
5
5
  "main": "index.js",
6
6
  "scripts": {