chaosdorf / mete

Matekasse
MIT License
47 stars 40 forks source link

✨ Allow mounting mete under subdir #96

Closed m0ppers closed 3 years ago

m0ppers commented 3 years ago

I want to run mete in a subdirectory. rails seems to have everything on board using RAILS_RELATIVE_URL_ROOT.

Unfortunately the menu had hardcoded links. This should be fixed now. Couldn't see anything else that needs to be adjusted :)

nomaster commented 3 years ago

Looks good to me. I just wonder if the assets are still served correctly when setting the RELATIVE_ROOT_URL to a non-empty value.

m0ppers commented 3 years ago

interesting! it looks ok...there were indeed some resources in the main layout template that had the wrong url (and which I overlooked because they didn't appear in my browser debug thingy)...these are now fixed

it sounds like you found other areas that have problems?

For me it works (tm) :joy:

2021-03-06T19:31:18,773833228+01:00

can you be specific where it is broken or were you just talking about the apple icons etc that I just fixed?

YtvwlD commented 3 years ago

The favicons, manifest and such stuff referenced in the main template now work. :)

The problem I had was with the main CSS and JS. They are being loaded correctly with RAILS_RELATIVE_URL_ROOT="/mete", but fail to load with RAILS_RELATIVE_URL_ROOT="/mete/". I'm not sure if this is a bug we can fix, but we could probably at least error out on startup if there is a trailing slash.

YtvwlD commented 3 years ago

Also, /mete/users.json redirects to /api/v1/users.json instead of /mete/api/v1/users.json.

m0ppers commented 3 years ago

uff...trailing slashes really break it big time. I implemented a basic check which should spit out a helpful error message.

I also fixed the redirect stuff :)

can you have a look at it again @YtvwlD ?

nomaster commented 3 years ago

Good work! 💪