File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -91,8 +91,14 @@ const roleArn = stringOrGetAtt('roleArn', 'Arn')
9191
9292const acceptParameters = Joi . object ( ) . pattern ( Joi . string ( ) , Joi . boolean ( ) . required ( ) )
9393
94+ /**
95+ * Changes for dynamic Path Override
96+ */
97+ const pathoverride = Joi . string ( )
98+
9499const proxy = Joi . object ( {
95100 path,
101+ pathoverride,
96102 method,
97103 cors,
98104 authorizationType,
Original file line number Diff line number Diff line change @@ -142,12 +142,21 @@ module.exports = {
142142 'Fn::GetAtt' : [ 'ApigatewayToS3Role' , 'Arn' ]
143143 }
144144
145+ /**
146+ * Dynamic Path Override
147+ */
148+ let pather = '{bucket}/{object}'
149+
150+ if ( _ . has ( http , 'pathoverride' ) ) {
151+ pather = '{bucket}/' + http . pathoverride
152+ }
153+
145154 const integration = {
146155 IntegrationHttpMethod : httpMethod ,
147156 Type : 'AWS' ,
148157 Credentials : roleArn ,
149158 Uri : {
150- 'Fn::Sub' : [ 'arn:aws:apigateway:${AWS::Region}:s3:path/{bucket}/{object}' , { } ]
159+ 'Fn::Sub' : [ 'arn:aws:apigateway:${AWS::Region}:s3:path/' + pather , { } ]
151160 } ,
152161 PassthroughBehavior : 'WHEN_NO_MATCH' ,
153162 RequestParameters : _ . merge ( requestParams , http . requestParameters )
Original file line number Diff line number Diff line change 11{
2- "name" : " serverless-apigateway-service-proxy" ,
3- "version" : " 1.3.0 " ,
4- "description" : " The Serverless Framewrok plugin for supporting AWS service proxy integration of API Gateway" ,
2+ "name" : " @hans_seek/ serverless-apigateway-service-proxy" ,
3+ "version" : " 1.3.1 " ,
4+ "description" : " This is a fork of https://www.npmjs.com/package/serverless-apigateway-service-proxy. The Serverless Framewrok plugin for supporting AWS service proxy integration of API Gateway" ,
55 "main" : " lib/index.js" ,
66 "scripts" : {
77 "lint" : " eslint ." ,
3131 " <rootDir>/__tests__/setup-tests.js"
3232 ]
3333 },
34- "author" : " horike37 " ,
34+ "author" : " Hans Roessler " ,
3535 "license" : " MIT" ,
3636 "devDependencies" : {
3737 "@commitlint/cli" : " ^8.1.0" ,
6161 },
6262 "repository" : {
6363 "type" : " git" ,
64- "url" : " https://github.com/horike37 /serverless-apigateway-service-proxy.git"
64+ "url" : " https://github.com/Hans-Seek /serverless-apigateway-service-proxy.git"
6565 }
6666}
You can’t perform that action at this time.
0 commit comments