example server: re-allow non-api prefixed apis

This commit is contained in:
AJ ONeal 2019-07-07 07:11:25 +00:00
parent 8f369226cf
commit f539de2611
1 changed files with 5 additions and 1 deletions

View File

@ -39,6 +39,7 @@ var glx = require("./").create({
approveDomains: myApproveDomains, // Greenlock's wraps around tls.SNICallback. Check the approveDomains: myApproveDomains, // Greenlock's wraps around tls.SNICallback. Check the
// domain name here and reject invalid ones // domain name here and reject invalid ones
servername: config.servername,
app: myVhostApp, // Any node-style http app (i.e. express, koa, hapi, rill) app: myVhostApp, // Any node-style http app (i.e. express, koa, hapi, rill)
/* CHANGE TO A VALID EMAIL */ /* CHANGE TO A VALID EMAIL */
@ -93,7 +94,10 @@ function myApproveDomains(opts) {
}) })
.then(function() { .then(function() {
// check for api prefix // check for api prefix
var apiname = "api." + bare; var apiname = bare;
if (domains.length) {
apiname = "api." + bare;
}
return checkApi(apiname) return checkApi(apiname)
.then(function(app) { .then(function(app) {
if (!app) { if (!app) {