Mellow
Mellow copied to clipboard
Support for base URL in mellow
Hi, is a base URL feature planned? So far I have all my streaming related services under the same domain and it would be neat to have mellow under the same domain as well. I tried to rewrite the URL in nginx it but mellow redirects me to the root path afterwards.
I wonder if this line: https://github.com/v0idp/Mellow/blob/46a6d80893f98e23cb556410add32e99080dc198/src/web/WebServer.js#L49 could be changed to allow a base url. With something like:
const BASE_URL = process.env.BASE_URL || '/';
// ...
this.app.use(BASE_URL, (req, res, next) => {
req.webserver = this;
if (req.cookies.token) req.headers.authorization = req.cookies.token;
next();
}, router);
//...
Not sure if there are other places where the root path is used though.
This should probably work. I'll look into it and add it.