@@ -8,6 +8,7 @@ const validate = require('./apiGateway/validate')
88const methods = require ( './apiGateway/methods' )
99const compileRestApi = require ( 'serverless/lib/plugins/aws/package/compile/events/apiGateway/lib/restApi' )
1010const compileResources = require ( 'serverless/lib/plugins/aws/package/compile/events/apiGateway/lib/resources' )
11+ const compileCors = require ( 'serverless/lib/plugins/aws/package/compile/events/apiGateway/lib/cors' )
1112const compileDeployment = require ( 'serverless/lib/plugins/aws/package/compile/events/apiGateway/lib/deployment' )
1213const getStackInfo = require ( 'serverless/lib/plugins/aws/info/getStackInfo' )
1314// Kinesis
@@ -29,12 +30,14 @@ class ServerlessApigatewayServiceProxy {
2930 this . service = this . serverless . service . service
3031 this . region = this . provider . getRegion ( )
3132 this . stage = this . provider . getStage ( )
33+ this . apiGatewayMethodLogicalIds = [ ]
3234 Object . assign (
3335 this ,
3436 compileRestApi ,
3537 compileResources ,
3638 compileMethodsToKinesis ,
3739 compileIamRoleToKinesis ,
40+ compileCors ,
3841 compileDeployment ,
3942 validateKinesisServiceProxy ,
4043 compileKinesisServiceProxy ,
@@ -53,13 +56,13 @@ class ServerlessApigatewayServiceProxy {
5356 this . validated = await this . validateServiceProxies ( )
5457 await this . compileRestApi ( )
5558 await this . compileResources ( )
59+ await this . compileCors ( )
5660
5761 //Kinesis proxy
5862 await this . compileKinesisServiceProxy ( )
5963
6064 // SQS getProxy
6165 await this . compileSqsServiceProxy ( )
62-
6366 if ( await this . existsDeployment ( ) ) {
6467 await this . compileDeployment ( )
6568 }
0 commit comments