Browse Source

Fix puter sites errors

KernelDeimos 1 năm trước cách đây
mục cha
commit
b7a1f21e31

+ 1 - 1
packages/backend/src/services/PuterSiteService.js

@@ -33,7 +33,7 @@ class PuterSiteService extends BaseService {
                 root_dir_id: this.config.devtest_directory,
             };
         }
-        const rows = await this.read(
+        const rows = await this.db.read(
             `SELECT * FROM subdomains WHERE subdomain = ? LIMIT 1`,
             [subdomain]
         );

+ 3 - 3
packages/backend/src/services/ServeGUIService.js

@@ -25,14 +25,14 @@ class ServeGUIService extends BaseService {
     async ['__on_install.routes-gui'] () {
         const { app } = this.services.get('web-server');
 
+        // is this a puter.site domain?
+        require('../routers/hosting/puter-site')(app);
+
         // Router for all other cases
         app.use(require('../routers/_default'))
 
         // Static files
         app.use(express.static(_path.join(__dirname, '../../public')))
-
-        // is this a puter.site domain?
-        require('../routers/hosting/puter-site')(app);
     }
 }