Skip to content

Instantly share code, notes, and snippets.

@gojko
Created December 23, 2016 01:38
Show Gist options
  • Save gojko/f19f61c19900d3b210cf5361da075509 to your computer and use it in GitHub Desktop.
Save gojko/f19f61c19900d3b210cf5361da075509 to your computer and use it in GitHub Desktop.
---
swagger: "2.0"
info:
version: "2016-12-23T01:28:46Z"
title: "geoip"
host: "xxxxx.execute-api.us-east-1.amazonaws.com"
basePath: "/prod"
schemes:
- "https"
paths:
/:
get:
consumes:
- "application/json"
produces:
- "application/json"
responses:
200:
description: "200 response"
schema:
$ref: "#/definitions/Empty"
headers:
Access-Control-Allow-Origin:
type: "string"
x-amazon-apigateway-integration:
responses:
default:
statusCode: "200"
responseParameters:
method.response.header.Access-Control-Allow-Origin: "'*'"
responseTemplates:
application/json: "{\n\"country\":\"$input.params().get('header').get('CloudFront-Viewer-Country')\"\
,\n\"ip\": \"$context.identity.sourceIp\"\n}"
requestTemplates:
application/json: "{\"statusCode\": 200}"
passthroughBehavior: "when_no_match"
type: "mock"
options:
consumes:
- "application/json"
produces:
- "application/json"
responses:
200:
description: "200 response"
schema:
$ref: "#/definitions/Empty"
headers:
Access-Control-Allow-Origin:
type: "string"
Access-Control-Allow-Methods:
type: "string"
Access-Control-Max-Age:
type: "string"
Access-Control-Allow-Headers:
type: "string"
x-amazon-apigateway-integration:
responses:
default:
statusCode: "200"
requestTemplates:
application/json: "{\"statusCode\": 200}"
passthroughBehavior: "when_no_match"
type: "mock"
definitions:
Empty:
type: "object"
title: "Empty Schema"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment