Last active
March 10, 2023 02:10
-
-
Save rpgreen/c127aa4ebbcaa9026be7 to your computer and use it in GitHub Desktop.
Revisions
-
rpgreen revised this gist
Jan 4, 2016 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -49,8 +49,6 @@ paths: responses: default: statusCode: "200" https://.*: statusCode: "302" responseParameters: -
rpgreen revised this gist
Jan 4, 2016 . No changes.There are no files selected for viewing
-
rpgreen revised this gist
Jan 4, 2016 . No changes.There are no files selected for viewing
-
rpgreen created this gist
Jan 4, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,92 @@ --- swagger: "2.0" basePath: "/test" schemes: - "https" paths: /lambdaredirect-default: get: produces: - "application/json" parameters: [] responses: 200: description: "200 response" schema: $ref: "#/definitions/Empty" headers: {} 302: description: "302 response" headers: Location: type: "string" x-amazon-apigateway-integration: responses: default: statusCode: "302" responseParameters: method.response.header.Location: "integration.response.body.location" uri: "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:[ACCOUNT_ID]:function:redirect-default/invocations" httpMethod: "POST" type: "aws" /lambdaredirect-error: get: produces: - "application/json" parameters: [] responses: 200: description: "200 response" schema: $ref: "#/definitions/Empty" headers: {} 302: description: "302 response" headers: Location: type: "string" x-amazon-apigateway-integration: responses: default: statusCode: "200" responseTemplates: application/json: "__passthrough__" https://.*: statusCode: "302" responseParameters: method.response.header.Location: "integration.response.body.errorMessage" responseTemplates: application/json: "## intentionally blank" uri: "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:[ACCOUNT_ID]]:function:redirect-error/invocations" httpMethod: "POST" type: "aws" securityDefinitions: sigv4: type: "apiKey" name: "Authorization" in: "header" x-amazon-apigateway-authtype: "awsSigv4" definitions: Empty: type: "object" -- Lambda Function "redirect-default": -- exports.handler = function(event, context) { context.succeed({ location : "https://example.com" }); }; -- Lambda Function "redirect-error": -- exports.handler = function(event, context) { context.fail("https://example.com"); };