Skip to content

Instantly share code, notes, and snippets.

@kixorz
Last active February 14, 2024 07:39
Show Gist options
  • Select an option

  • Save kixorz/3b172e2fc3ce35421ee9 to your computer and use it in GitHub Desktop.

Select an option

Save kixorz/3b172e2fc3ce35421ee9 to your computer and use it in GitHub Desktop.

Revisions

  1. kixorz revised this gist Sep 17, 2015. No changes.
  2. kixorz created this gist Sep 17, 2015.
    18 changes: 18 additions & 0 deletions aws_lambda_public_ip.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    var http = require('http');

    exports.handler = function(event, context) {
    http.get('http://httpbin.org/get', function(res) {
    var body = '';
    res.on('data', function(chunk) {
    body += chunk;
    });

    res.on('end', function() {
    console.info(body);
    context.done(null);
    });
    }).on('error', function(e) {
    console.error(e.message);
    context.fail(null);
    });
    };