Skip to content

Instantly share code, notes, and snippets.

baodinh / go
Created August 26, 2020 20:24
Convert data:image/png;base64,iVBORw0KGgoAAA to []byte
func streamToByte(stream io.Reader) []byte {
buf := new(bytes.Buffer)
return buf.Bytes()
// pass reader to NewDecoder
dec := base64.NewDecoder(base64.StdEncoding, strings.NewReader(base64string[i+1:]))
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script id="jsbin-javascript">
var AWS = require("aws-sdk");
accessKeyId: "",
secretAccessKey: "",
region: "us-west-2"
var s3 = new AWS.S3();
var bucketName = "movieinfos3";
<p>This topic describes how to Create AWS Lambda Node.js function that gets all images from S3, and deploy it into AWS API Gateway.</p>
<p>Scenario: </p>
<p>In S3 has the object contains the images arranged by movieid(folder) like:</p>
<div class="text-center"><img src=""/></div>
<p>I want to create api to access all of the images by movieid. So the result api will be like this:</p>
<pre> </pre>
<div class="text-center"><img src=""/></div>
<p>This documentation guides you through our simple Node.js Lambda example function in detail.</p>
<p>Note: Strongly suggests you familiarize yourself with <a href="">Programming Model (Node.js)</a> in the AWS Lambda Developer Guide before continuing.</p>
<p>Example content:</p>