@@ -114,10 +114,14 @@ export const register = async (
114
114
} )
115
115
} )
116
116
117
- const workingDir = args . _ && args . _ . length > 0 ? path . resolve ( args . _ [ args . _ . length - 1 ] ) : undefined
118
- const pluginApi = new PluginAPI ( logger , process . env . CS_PLUGIN , process . env . CS_PLUGIN_PATH , workingDir )
119
- await pluginApi . loadPlugins ( )
120
- pluginApi . mount ( app , wsApp )
117
+ if ( ! process . env . CS_DISABLE_PLUGINS ) {
118
+ const workingDir = args . _ && args . _ . length > 0 ? path . resolve ( args . _ [ args . _ . length - 1 ] ) : undefined
119
+ const pluginApi = new PluginAPI ( logger , process . env . CS_PLUGIN , process . env . CS_PLUGIN_PATH , workingDir )
120
+ await pluginApi . loadPlugins ( )
121
+ pluginApi . mount ( app , wsApp )
122
+ app . use ( "/api/applications" , apps . router ( pluginApi ) )
123
+ wrapper . onDispose ( ( ) => pluginApi . dispose ( ) )
124
+ }
121
125
122
126
app . use ( bodyParser . json ( ) )
123
127
app . use ( bodyParser . urlencoded ( { extended : true } ) )
@@ -141,9 +145,6 @@ export const register = async (
141
145
app . use ( "/static" , _static . router )
142
146
app . use ( "/update" , update . router )
143
147
144
- app . use ( "/api/applications" , apps . router ( pluginApi ) )
145
- wrapper . onDispose ( ( ) => pluginApi . dispose ( ) )
146
-
147
148
app . use ( ( ) => {
148
149
throw new HttpError ( "Not Found" , HttpCode . NotFound )
149
150
} )
0 commit comments