Skip to content

Commit ad9f5af

Browse files
committed
un pequeño ejemplo de scrapper
0 parents  commit ad9f5af

File tree

953 files changed

+179350
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

953 files changed

+179350
-0
lines changed

app.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
var express = require('express'),
2+
http = require('http'),
3+
bodyParser = require('body-parser'),
4+
app = express();
5+
6+
var server = http.createServer(app);
7+
var scrap = require('./scrap');
8+
9+
app.use(bodyParser.json());
10+
11+
app.get('/diputados', function(req,res) {
12+
res.set("Content-Type", "application/json; charset=utf-8");
13+
scrap.getDiputadosAll(function(data){
14+
res.json(data);
15+
})
16+
});
17+
app.get('/diputado/:id',function(req,res) {
18+
var id = req.params.id;
19+
scrap.getDiputado(id,function (data) {
20+
res.json(data);
21+
});
22+
})
23+
app.get('/', function(req, res) {
24+
res.send('Hola bienvenido a diputados');
25+
});
26+
27+
server.listen(3000, function() {
28+
console.log('server corriendo en el puerto 3000');
29+
});

node_modules/body-parser/HISTORY.md

Lines changed: 250 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/body-parser/LICENSE

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)