-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
37 lines (27 loc) · 905 Bytes
/
app.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
29
30
31
32
33
34
35
36
37
var express = require('express');
var app = express();
// var redis;
// if (process.env.REDISTOGO_URL) {
// // redistogo connection
// var rtg = require("url").parse(process.env.REDISTOGO_URL);
// redis = require("redis").createClient(rtg.port, rtg.hostname);
// redis.auth(rtg.auth.split(":")[1]);
// } else {
// redis = require("redis");
// //our code is the client
// var client = redis.createClient();
// }
app.get('/', function (req, res) {
res.send('hello world');
});
// app.get('/', function (req, res) {
// client.incr("visitors") // increment visitors
// client.get("visitors", function(err, value) {
// res.send('Hello visitor number ' + value + '!');
// });
// });
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});