Created
March 8, 2019 08:58
Star
You must be signed in to star a gist
Medium Blog: Leveraging Docker Multi-Stage Builds to optimize Dockerfile/Image
This file contains 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
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); | |
}); |
This file contains 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
{ | |
"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