@@ -239,10 +239,21 @@ const prepareInputs = async (instance, credentials, inputs = {}) => {
239
239
functionConf . needSetTraffic = inputs . traffic !== undefined && functionConf . lastVersion
240
240
241
241
if ( tempFunctionConf . environment ) {
242
- functionConf . environment = inputs . functionConf . environment
242
+ functionConf . environment = tempFunctionConf . environment
243
+ functionConf . environment . variables = functionConf . environment . variables || { }
244
+ functionConf . environment . variables . SERVERLESS = '1'
245
+ functionConf . environment . variables . SLS_ENTRY_FILE = inputs . entryFile || CONFIGS . defaultEntryFile
246
+ } else {
247
+ functionConf . environment = {
248
+ variables : {
249
+ SERVERLESS : '1' ,
250
+ SLS_ENTRY_FILE : inputs . entryFile || CONFIGS . defaultEntryFile
251
+ }
252
+ }
243
253
}
254
+
244
255
if ( tempFunctionConf . vpcConfig ) {
245
- functionConf . vpcConfig = inputs . functionConf . vpcConfig
256
+ functionConf . vpcConfig = tempFunctionConf . vpcConfig
246
257
}
247
258
248
259
// 对apigw inputs进行标准化
@@ -257,19 +268,22 @@ const prepareInputs = async (instance, credentials, inputs = {}) => {
257
268
isDisabled : tempApigwConf . isDisabled === true ,
258
269
fromClientRemark : fromClientRemark ,
259
270
serviceName : inputs . serviceName || getDefaultServiceName ( instance ) ,
260
- description : getDefaultServiceDescription ( instance ) ,
271
+ description : tempApigwConf . description || getDefaultServiceDescription ( instance ) ,
261
272
protocols : tempApigwConf . protocols || [ 'http' ] ,
262
273
environment : tempApigwConf . environment ? tempApigwConf . environment : 'release' ,
263
274
endpoints : [
264
275
{
265
- path : '/' ,
276
+ path : tempApigwConf . path || '/' ,
266
277
enableCORS : tempApigwConf . enableCORS ,
267
278
serviceTimeout : tempApigwConf . serviceTimeout ,
268
279
method : 'ANY' ,
280
+ apiName : tempApigwConf . apiName || 'index' ,
269
281
function : {
270
282
isIntegratedResponse : true ,
271
283
functionName : functionConf . name ,
272
- functionNamespace : functionConf . namespace
284
+ functionNamespace : functionConf . namespace ,
285
+ functionQualifier :
286
+ ( tempApigwConf . function && tempApigwConf . function . functionQualifier ) || '$LATEST'
273
287
}
274
288
}
275
289
] ,
0 commit comments