Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

muestro el precio en el index

  • Loading branch information...
commit a0119bf6338a9f79c3f8d7c1004c6f4ae0601393 1 parent 5383ce5
cronopio authored
Showing with 10 additions and 5 deletions.
  1. +8 −4 server.js
  2. +2 −1  views/index.jade
View
12 server.js
@@ -5,7 +5,7 @@
var express = require('express');
var mongoose = require('mongoose');
-var btcPrices = require('jsonreq');
+var jsonreq = require('jsonreq');
var app = module.exports = express.createServer();
@@ -35,9 +35,13 @@ app.db = mongoose.connect(app.set('db-uri'));
// Routes
app.get('/', function(req, res){
- btcPrices.get('http://bitcoincharts.com/t/weighted_prices.json', function(err, data) {
- res.send(data);
- })
+ jsonreq.get('http://bitcoincharts.com/t/weighted_prices.json', function(err, data) {
+ res.render('index', {
+ title:'Precio del Bitcoin en Facebook',
+ locals:{dolares:data.USD['24h']}
+ });
+ });
+
});
app.listen(3000);
View
3  views/index.jade
@@ -1,2 +1,3 @@
h1= title
-p Welcome to #{title}
+p Bienvenido a #{title}
+p El precio para Hoy: USD$ #{dolares}
Please sign in to comment.
Something went wrong with that request. Please try again.