From f539de2611778e87e2d6fcc2163b00ffaaef4de9 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 7 Jul 2019 07:11:25 +0000 Subject: [PATCH] example server: re-allow non-api prefixed apis --- server.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index ce6acff..c586801 100644 --- a/server.js +++ b/server.js @@ -39,6 +39,7 @@ var glx = require("./").create({ approveDomains: myApproveDomains, // Greenlock's wraps around tls.SNICallback. Check the // domain name here and reject invalid ones + servername: config.servername, app: myVhostApp, // Any node-style http app (i.e. express, koa, hapi, rill) /* CHANGE TO A VALID EMAIL */ @@ -93,7 +94,10 @@ function myApproveDomains(opts) { }) .then(function() { // check for api prefix - var apiname = "api." + bare; + var apiname = bare; + if (domains.length) { + apiname = "api." + bare; + } return checkApi(apiname) .then(function(app) { if (!app) {