-
Notifications
You must be signed in to change notification settings - Fork 128
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
Add option for custom base path #85
Conversation
…r that will mount the server on the specified path (useful when running behind proxies).
Update README with latest help (including —base-path)
1 similar comment
Thin::Server.start(*config.web_interface) do | ||
run Redmon::App.new | ||
map base_path do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be (I need to look to make sure) more efficient if an instance of Redmon::App was constructed outside and then referenced by the block.
app = Redmon::App.new
map base_path do
run app
end
or if you want to module scope the instance
map base_path do
run @@app ||= Redmon::App.new
end
thoughts?
- move app instance outside of the map block
Hey @steelThread thanks for the feedback! I went with the first option for now and tested things (no issue). I also made a change to switch the default base_path to '' vs '/' as it was a little annoying to see the extra trailing slash all of the time when not needed. Let me know what you think! Thanks |
@krsyoung - lgtm. |
The purpose of this code is to support #78 which needs a way to specify a custom base path when running redmon from within Thin.
The common use case for this is to serve redmon from behind a frontend web proxy (currently the assets won't load). This code provides a new command line option that can be used as follows:
This will run the Thin server and serve the content up at
http://localhost:4567/redmon
. For those running Docker, this will work very nicely with an Image like: https://hub.docker.com/r/vieux/redmon/Comments & improvements welcomed!