Mellow icon indicating copy to clipboard operation
Mellow copied to clipboard

Support for base URL in mellow

Open antoniozh opened this issue 5 years ago • 2 comments

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.

antoniozh avatar May 26 '20 12:05 antoniozh

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.

devster31 avatar May 27 '20 23:05 devster31

This should probably work. I'll look into it and add it.

v0idp avatar May 28 '20 09:05 v0idp