-
Notifications
You must be signed in to change notification settings - Fork 0
/
web.js
29 lines (26 loc) · 942 Bytes
/
web.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* Created by martalm on 18.02.2016.
*/
var express = require('express');
var request = require('request');
var app = express();
app.use('/', express.static(__dirname + '/app'));
app.get('/api/tweets', function(req, res) {
var flutrackUrl = 'http://flutrack-backend.herokuapp.com/tweets';
request(flutrackUrl).pipe(res);
});
app.get('/api/prediction', function(req, res) {
var flutrackUrl = 'http://flutrack-backend.herokuapp.com/prediction';
request(flutrackUrl).pipe(res);
});
app.get('/test/prediction', function(req, res) {
var flutrackUrl = 'http://127.0.0.1:8000/prediction';
request(flutrackUrl).pipe(res);
});
app.get('/test/tweets', function(req, res) {
var flutrackUrl = 'http://127.0.0.1:8000/tweets';
request(flutrackUrl).pipe(res);
});
app.listen(process.env.PORT || 5000, function(){
console.log("Server started. Running on port " + (process.env.PORT ? process.env.PORT : 5000));
});