Created
May 20, 2015 00:02
-
-
Save having-fun-coding/20948051c48a99faacf2 to your computer and use it in GitHub Desktop.
Real Time Web | Express Server | Code School
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 url = require('url'); | |
| var request = require('request'); | |
| var express = require('express'); | |
| var options = { | |
| protocol: "http:", | |
| host: "search.twitter.com", | |
| pathname: '/search.json', | |
| query: { | |
| q: "codeschool" | |
| } | |
| }; | |
| var searchURL = url.format(options); | |
| var app = express(); | |
| app.get('/', function(req, res) { | |
| request(searchURL).pipe(res); | |
| }); | |
| app.listen(8080); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment