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