Skip to content

Instantly share code, notes, and snippets.

@RichFromGalvanize
Last active January 4, 2019 07:48
Show Gist options
  • Save RichFromGalvanize/5873044 to your computer and use it in GitHub Desktop.
Save RichFromGalvanize/5873044 to your computer and use it in GitHub Desktop.
An image piping example using Node.js, express, and request...BOOYA!
var request = require('request');
var express = require('express');
var app = express();
app.get('/goofy', function(req, res) {
request('http://images1.wikia.nocookie.net/__cb20120715102950/disney/images/a/a5/Disneygoofy2012.jpeg').pipe(res);
});
app.get('/loop', function(req, res) {
res.render('mypage');
});
app.listen(9999);
@brunolemos
Copy link

Thanks!

@bakoushin
Copy link

👍

@marlonlom
Copy link

marlonlom commented Jan 26, 2018

Great! thanks!!! :D

@yPhil-gh
Copy link

Looks nice ; Hey what if I want to write the image to disk (to cache it) and send back its filepath instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment