Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Medium Blog: Leveraging Docker Multi-Stage Builds to optimize Dockerfile/Image
const https = require('https');
https.get('https://api.nasa.gov/planetary/apod?api_key=<api_key>', (resp) => {
let data = '';
// A chunk of data has been recieved.
resp.on('data', (chunk) => {
data += chunk;
});
// The whole response has been received. Print out the result.
resp.on('end', () => {
console.log(JSON.parse(data));
});
}).on("error", (err) => {
console.log("Error: " + err.message);
});
{
"name": "test-multistage",
"version": "1.0.0",
"description": "sample binary to show multistage",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"pkg": {
"scripts": "index.js"
},
"keywords": [
"sample",
"code"
],
"author": "kumarrishav",
"license": "ISC"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.