Permalink
Browse files

Drop Process interface

  • Loading branch information...
1 parent c1b0a9a commit 51111acff359631a2c191bfb81a476ce9e2c95e4 @hueniverse committed Sep 10, 2012
Showing with 5 additions and 10 deletions.
  1. +5 −5 api/index.js
  2. +0 −5 config.js.example
View
@@ -57,12 +57,13 @@ internals.onPostHandler = function (request, next) {
};
-// Create and configure server instance
+// Catch uncaught exceptions
-Hapi.Process.initialize({
- process: Config.process.api
+process.on('uncaughtException', function (err) {
+ Hapi.Utils.abort('Uncaught exception: ' + err.stack);
});
+
var configuration = {
name: 'http',
@@ -94,7 +95,7 @@ var configuration = {
debug: true
};
-var server = new Hapi.Server.Server(Config.host.api.domain, Config.host.api.port, configuration);
+var server = new Hapi.Server(Config.host.api.domain, Config.host.api.port, configuration);
server.addRoutes(Routes.endpoints);
// Initialize database connection
@@ -112,7 +113,6 @@ Db.initialize(function (err) {
server.start();
Stream.initialize(server.listener);
- Hapi.Process.finalize();
}
else {
View
@@ -51,11 +51,6 @@ exports.process = {
// key: 'cert/postmile.net.key',
// cert: 'cert/postmile.net.crt'
// }
- },
-
- api: {
-
- // runAs: 'www-data',
}
};

0 comments on commit 51111ac

Please sign in to comment.