|
|
var express = require('express');
|
|
|
var app = express();
|
|
|
|
|
|
var request = require('request');
|
|
|
var fs = require('fs');
|
|
|
|
|
|
var app = express();
|
|
|
|
|
|
app.use(function(req, res, next){
|
|
|
console.log('%s %s', req.method, req.url);
|
|
|
next();
|
...
|
...
|
@@ -70,10 +71,19 @@ app.post('/fb',function(req,res) |
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
app.listen(80);
|
|
|
|
|
|
|
|
|
app.get('/google',function(req,res)
|
|
|
{
|
|
|
request('http://maps.google.cn/maps/api/geocode/json'+req._parsedUrl.search, function (error, response, body)
|
|
|
{
|
|
|
if (error && response.statusCode != 200)
|
|
|
{
|
|
|
console.log(error);
|
|
|
}
|
|
|
res.send(body);
|
|
|
});
|
|
|
})
|
|
|
|
|
|
|
|
|
console.log('OK!'); |
...
|
...
|
|