source: Dev/trunk/src/server/standalone.js @ 463

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
RevLine 
[463]1var fs = require("fs");
2var https = require("https");
3var os = require("os");
4var path = require("path");
5var _ = require("underscore");
6
7var app = require('./app').App({
8    couchDbURL: 'http://localhost:5984/qed'
9});
10
11var httpsOptions = {
12    key: fs.readFileSync(path.resolve('../qed-server.key')),
13    cert: fs.readFileSync(path.resolve('../qed-server.pem'))
14};
15
16var server = https.createServer(httpsOptions, app);
17server.listen(8443);
18
19console.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.