-
-
Save boostup/2693194daec9f1eb6127c91274a1d6cb to your computer and use it in GitHub Desktop.
node.js: an image piping example using express and request
This file contains hidden or 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
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