From f1e710391df875b36cc29a446565095f348cee5d Mon Sep 17 00:00:00 2001 From: Zachary Carter Date: Fri, 7 Dec 2012 11:25:12 -0800 Subject: [PATCH] enable unauthorized access to docs --- bin/api | 3 +++ etc/config.js | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/api b/bin/api index baba2db..cce3f59 100755 --- a/bin/api +++ b/bin/api @@ -33,6 +33,9 @@ apiOptions.auth.getCredentialsFunc = credentialsFunc; var bindTo = config.process.api; var server = new Hapi.Server(bindTo.host, bindTo.port, apiOptions); +// don't require authorization for docs +server._routes['get'][0].config.auth = config.hapi.docs.auth; + console.log("api starting up"); // now load up api handlers diff --git a/etc/config.js b/etc/config.js index 0b0949a..b309d8e 100644 --- a/etc/config.js +++ b/etc/config.js @@ -21,7 +21,11 @@ var config = module.exports = { }, hapi: { name: "Gombot API Server", - docs: true, + docs: { + auth: { + mode: 'none' + } + }, auth: { scheme: 'hawk' }