I'm building a set of rest APIs on firebase. I've generated docs with both swagger (for "external" docs) and jsdoc (for "internal" ones). Hence, from jsdoc, I have a bunch of HTML pages that I want to deploy onto FB hosting, but I want to restrict access to such pages only to some authenticated users.
For dynamic content, e.g. swagger-generated, I've easily solved as follows.
doc_fun.use(
'/rest',
basicAuth({
users: {'user': 'password'},
challenge: true,
}),
swaggerUi.serve,
swaggerUi.setup(swaggerSpec)
)
exports.docs = functions.https.onRequest(doc_fun)
I'm looking for (possibly similar) solution for static content. Something like:
doc_fun.use(
'/jsdoc',
basicAuth({
users: {'user': 'password'},
challenge: true,
}),
express.static('public/jsdoc')
)
(which, of course, doesn't work)