@@ -61,7 +61,7 @@ class Application extends events.EventEmitter {
6161 }
6262 }
6363
64- runScript ( methodName , session ) {
64+ runMethod ( methodName , session ) {
6565 const script = this . api . get ( methodName ) ;
6666 if ( ! script ) return null ;
6767 const exp = script ( session ? session . context : EMPTY_CONTEXT ) ;
@@ -103,15 +103,16 @@ class Application extends events.EventEmitter {
103103
104104 async loadPlace ( place , placePath ) {
105105 const files = await fsp . readdir ( placePath , { withFileTypes : true } ) ;
106+ const isStatic = place === 'static' ;
106107 for ( const file of files ) {
107108 const filePath = path . join ( placePath , file . name ) ;
108- if ( place !== 'static' ) await this . loadScript ( place , filePath ) ;
109+ if ( ! isStatic ) await this . loadScript ( place , filePath ) ;
109110 else if ( file . isDirectory ( ) ) await this . loadPlace ( place , filePath ) ;
110111 else await this . loadFile ( filePath ) ;
111112 }
112113 fs . watch ( placePath , ( event , fileName ) => {
113114 const filePath = path . join ( placePath , fileName ) ;
114- if ( place === 'static' ) this . loadFile ( filePath ) ;
115+ if ( isStatic ) this . loadFile ( filePath ) ;
115116 else this . loadScript ( place , filePath ) ;
116117 } ) ;
117118 }
0 commit comments