Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed namespace option #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

SachsKaylee
Copy link

@SachsKaylee SachsKaylee commented Jul 10, 2020

Closes #12

I could not get this plug to work without these changes as the redirects were really unexpected, especially when hosting the application in a nested route.

If I add the following line to my Plug.Router at /api/admin:
forward "/fun_with_flags", to: FunWithFlags.UI.Router

The fun with flags endpoint will automatically be available at /api/admin/fun_with_flags

Some notes:

  • I was not able to run the unit tests since I do not have a Redis instance. I adjusted them the best I could but you probably will want to run them yourself before merging this.
  • This is most likely a breaking change, requiring a major version upgrade if you follow SemVer
  • I did not test this with Phoenix as I do not use Phoenix, only raw Plug with Ecto.
  • This was inspired by the way the Bamboo Mailer does this, which I found very easy to integrate: https://github.com/thoughtbot/bamboo/blob/master/lib/bamboo/plug/sent_email_viewer/email_preview_plug.ex#L107

I might follow up with a smaller unrelated PR later, but this is a really important change for me.

Thank you for your time and I apologize for the inconvenience of you having to test my PR :)

@SachsKaylee
Copy link
Author

Oops, I just noticed that there already is an open PR for this with #15 - Is there any ETA on getting any of these two PRs merged?
Thank you for your time. I understand that maintaining open source projects can be a big time effort down the road.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use conn.script_name instead of namespace to construct paths
1 participant