-
Notifications
You must be signed in to change notification settings - Fork 275
/
main.js
43 lines (43 loc) · 1.74 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
exports.apiConfig = function () {
'use strict';
return {
version: 4,
authorizers: {
first: { lambdaName: 'nameOnly' },
second: { lambdaName: 'name', lambdaVersion: 'version' },
third: { lambdaArn: 'arn' }
},
routes: {
authorizers: { 'GET': { customAuthorizer: 'first', success: { contentType: 'text/html' }, error: { headers: {'Content-Type': 'xxx'}}}},
successCode: { 'GET': { success: 302 } },
enumeratedSuccessHeaders: { 'GET': { success: { headers: ['Mix', 'Max'] } } },
defaultedSuccessHeaders: { 'GET': { success: { headers: {'Mix': 'Max'} } } },
twoMethods: { 'GET': { success: 302 }, 'POST': { error: { code: 404 } } },
withIam: { 'GET': { authorizationType: 'AWS_IAM' } },
withCredentials: { 'GET': {authorizationType: 'AWS_IAM', invokeWithCredentials: 'arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/Bob' }},
passingCredentials: { 'GET': {authorizationType: 'AWS_IAM', invokeWithCredentials: true }},
withOnlyCredentials: { 'GET': {invokeWithCredentials: 'arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/Bob' }},
passingOnlyCredentials: { 'GET': {invokeWithCredentials: true }},
withAuthorizer: { customAuthorizer: 'first' },
withAuthorizerAndAuthType: { customAuthorizer: 'first', authorizationType: 'CUSTOM' }
},
customResponses: {
'DEFAULT_4XX': {
responseParameters: {
'gatewayresponse.header.x-response-claudia': '\'yes\'',
'gatewayresponse.header.x-name': 'method.request.header.name'
},
headers: {
'x-response-claudia': 'no',
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': 'a.b.c'
},
statusCode: 411
}
}
};
};
exports.proxyRouter = function (event, context) {
'use strict';
context.succeed(event);
};