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 characters
| import json | |
| import urllib | |
| import re | |
| def lambda_handler(event, context): | |
| if 'cnpj' in event and _regex(event['cnpj']): | |
| return json.loads(urllib.request.urlopen(_getUrlApi(event['cnpj'])).read()) | |
| return json.loads("{\"status\": \"error\", \"message\": \"Formato incorreto\"}") |
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 characters
| var dns = require('dns'); | |
| function getMxRecords(domain){ | |
| return new Promise(function(resolve, reject) { | |
| dns.resolveMx(domain, function (err, addresses) { | |
| if (err) { | |
| //console.log(err, err.stack) | |
| resolve(null); | |
| } |
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 characters
| git reset <commit id> | |
| git reset --soft HEAD@{1} | |
| git commit -m "Revert to <commit id>" | |
| git reset --hard |
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 characters
| { | |
| "body" : $input.json('$'), | |
| "headers": { | |
| #foreach($header in $input.params().header.keySet()) | |
| "$header": "$util.escapeJavaScript($input.params().header.get($header))" #if($foreach.hasNext),#end | |
| #end | |
| }, | |
| "method": "$context.httpMethod", | |
| "params": { | |
| #foreach($param in $input.params().path.keySet()) |
NewerOlder