Last change
on this file since 464 was
464,
checked in by hendrikvanantwerpen, 12 years ago
|
Working deployment to Heroku.
|
File size:
757 bytes
|
Line | |
---|
1 | var fs = require("fs"); |
---|
2 | var https = require("https"); |
---|
3 | var os = require("os"); |
---|
4 | var _ = require("underscore"); |
---|
5 | |
---|
6 | var app = require('./app').App({ |
---|
7 | couchDbURL: 'http://localhost:5984/qed' |
---|
8 | }); |
---|
9 | |
---|
10 | var httpsOptions = { |
---|
11 | key: fs.readFileSync(__dirname+'/../qed-server.key'), |
---|
12 | cert: fs.readFileSync(__dirname+'/../qed-server.pem') |
---|
13 | }; |
---|
14 | |
---|
15 | var server = https.createServer(httpsOptions, app); |
---|
16 | server.listen(8443); |
---|
17 | |
---|
18 | console.log( |
---|
19 | "Listening on " + |
---|
20 | _.chain(os.networkInterfaces()) |
---|
21 | .map(function(value,key){ return value; }) |
---|
22 | .flatten() |
---|
23 | .filter(function(intf){ return intf.family === "IPv4" && !intf.internal; }) |
---|
24 | .reduce(function(urls, intf){ return urls+', http://'+intf.address+':8443/'; }, "http://127.0.0.1:8443/") |
---|
25 | .value() + "."); |
---|
Note: See
TracBrowser
for help on using the repository browser.