Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manifest limitation on server options #2

Closed
csrl opened this issue Nov 26, 2014 · 2 comments
Closed

manifest limitation on server options #2

csrl opened this issue Nov 26, 2014 · 2 comments
Assignees
Labels
feature New functionality or improvement
Milestone

Comments

@csrl
Copy link
Contributor

csrl commented Nov 26, 2014

Glue restricts what is passed as options to new Hapi.Server(options), only allowing 'app', 'debug' and 'cache' members to the options.

It'd be useful to be able to define the full server options that are available.

@csrl
Copy link
Contributor Author

csrl commented Nov 26, 2014

May I suggest a change something to the affect of:

diff --git a/lib/index.js b/lib/index.js
index 5fef30a..22b555b 100755
--- a/lib/index.js
+++ b/lib/index.js
@@ -13,19 +13,8 @@ var internals = {};


 internals.schema = Joi.object({
-    server: Joi.object({
-        app: Joi.object().allow(null),
-        debug: Joi.object({
-            request: Joi.array().allow(false)
-        }).allow(false),
-        cache: Joi.alternatives([
-            Joi.string(),
-            Joi.object(),
-            Joi.func(),
-            Joi.array().includes(Joi.object()).min(1)
-        ]).allow(null)
-    }),
-    connections: Joi.array().required().min(1),
+    server: Joi.object(),
+    connections: Joi.array(),
     plugins: Joi.object()
 });

@@ -114,8 +103,12 @@ exports.compose = function (manifest /*, [options], callback */) {
     var server = new Hapi.Server(packSettings);

     // Load connections
+    var connections = manifest.connections;
+    if (0 === connections.length) {
+        connections.push({});
+    }

-    manifest.connections.forEach(function (connection) {
+    connections.forEach(function (connection) {

         server.connection(connection);
     });

@hueniverse hueniverse self-assigned this Nov 26, 2014
@hueniverse hueniverse added this to the 2.0.0 milestone Nov 26, 2014
@Marsup Marsup added feature New functionality or improvement and removed request labels Sep 21, 2019
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

3 participants