Skip to content

Commit

Permalink
feat(server): open browser automatically on server start
Browse files Browse the repository at this point in the history
  • Loading branch information
petebacondarwin committed Mar 28, 2013
1 parent 70b5d45 commit 847cc83
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"passport": "~0.1.12",
"passport-local": "~0.1.6",
"restler": "~2.0.1",
"express-namespace": "~0.1.1"
"express-namespace": "~0.1.1",
"open": "0.0.3"
},
"devDependencies": {
"rewire": "~1.0.3",
Expand Down
6 changes: 5 additions & 1 deletion server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ app.all('/*', function(req, res) {
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));

// Start up the server on the port specified in the config
server.listen(config.server.listenPort);
server.listen(config.server.listenPort, 'localhost', 511, function() {
// // Once the server is listening we automatically open up a browser
var open = require('open');
open('http://localhost:' + config.server.listenPort + '/');
});
console.log('Angular App Server - listening on port: ' + config.server.listenPort);
secureServer.listen(config.server.securePort);
console.log('Angular App Server - listening on secure port: ' + config.server.securePort);

0 comments on commit 847cc83

Please sign in to comment.