Allow arena to work as a node module alongside auth middleware.
I have been unable to find a way to add arena to an existing express app while also implementing authentication. The basePath parameter conflicts with any path other than "/" provided to express' use method. Allowing users to provide a new parameter called "mountPath" can alleviate this issue and allow configs like the following to work:
const arena = Arena({
queues
}, {
basePath: '/admin/',
mountPath: '/',
disableListen: true
})
app.use('/admin', basicAuth('foo', 'bar'), arena)
where basicAuth = https://github.com/expressjs/basic-auth-connect
I'm looking forward to this
Any updates on this?
I have no idea why it is not merged yet. However, here is a workaround at the moment:
const arena = Arena({
queues
}, {
basePath: '/',
disableListen: true
})
// powerhacking
arena.locals.appBasePath = "/admin"
app.use('/admin', basicAuth('foo', 'bar'), arena)
Merging #182 into this.