Skip to content

Instantly share code, notes, and snippets.

@boostup
Forked from RichFromGalvanize/gist:5873044
Last active July 24, 2020 10:43
Show Gist options
  • Save boostup/2693194daec9f1eb6127c91274a1d6cb to your computer and use it in GitHub Desktop.
Save boostup/2693194daec9f1eb6127c91274a1d6cb to your computer and use it in GitHub Desktop.
node.js: an image piping example using express and request
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment