Advertisement
Guest User

Untitled

a guest
May 30th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. // require deployd
  2. var deployd = require('deployd');
  3.  
  4. // configure database etc.
  5. var server = deployd({
  6. port: process.env.PORT || 1337,
  7. env: 'production',
  8. db: { connectionString: process.env.MONGOHQ_URL }
  9. });
  10.  
  11. // start the server
  12. server.listen();
  13.  
  14. // debug
  15. server.on('listening', function() {
  16. console.log("Server is listening on port: " + (process.env.PORT || 1337));
  17. });
  18.  
  19. // Deployd requires this
  20. server.on('error', function(err) {
  21. console.error(err);
  22. process.nextTick(function() { // Give the server a chance to return an error
  23. process.exit();
  24. });
  25. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement