2014-06-02 14:00:24 -07:00
|
|
|
var express = require('express');
|
2014-06-24 08:36:32 -07:00
|
|
|
var http = require('http');
|
|
|
|
var app = express();
|
2014-04-20 12:46:03 -07:00
|
|
|
|
2014-06-02 14:00:24 -07:00
|
|
|
app.start = function(port, callback) {
|
2014-04-20 12:46:03 -07:00
|
|
|
|
2014-06-02 14:00:24 -07:00
|
|
|
app.set('port', port);
|
|
|
|
app.use(express.static(__dirname));
|
2014-04-20 12:46:03 -07:00
|
|
|
|
2014-06-02 14:00:24 -07:00
|
|
|
app.listen(port, function() {
|
|
|
|
callback('http://localhost:' + port);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = app;
|
2014-06-06 11:23:40 -07:00
|
|
|
|
|
|
|
// if we are running in the copay shell context, initialize the shell bindings
|
|
|
|
if (process.versions && process.versions['atom-shell']) {
|
|
|
|
require('./shell')(app);
|
|
|
|
}
|