I've implemented command line options for port, environment, confdir and daemon. As per #391 we don't support auto reload in Dancer2. This also fixes #385
I've tested on OSX and CentOS. It works. However, there was a small design problem here. I could not import the setting method into Dancer2.pm or GetOpt.pm, I later learned probably this idea is wrong for Dancer2 and I might need to change the configs on the instance. ($runner->config or $app->config) I tried a whole lot of options and none of them worked.
More importantly setting(port => 1234) doesn't work from anywhere once the defaults have been loaded.
setting(port => 1234)
I finally just set the $ENV to the appropriate config and this works.
I'm open to refactoring this PR or making any more changes needed to implement this correctly, if this is not acceptable 😄
Work in progress for issue #393. I've added the files and written most
of the necessary code. However I can't seem to find the right way to set
the setting once I parse the command line options.
Still work in progress for #393. Double checked by testing how
environment can be set. And my suspicions are correct.
Implemented command line options for dancer2 standalone server.
This fixes issue #393. Besides environment, you can also set port,
confdir and is daemon from the commandline like Dancer1.
The only catch here is that I implemented this feature by setting the
Removed unwanted method.
Fixed incorrect spacing.
Fellow core developers, do we want to apply this change in general. It needs to be reworked for the current codebase, so we should agree whether it is worth it.
Considering our efforts of stripping the core to something smaller, I'm not sure this is required.
Looking at the supported options, we have: port, environment, daemon, and confdir:
@gideondsouza We really appreciate the work you've done on this. I'm sorry if we end up not making use of it. I do believe it helped us understand things much better so even if it's not used, the work you put into it was of value, and is appreciated. :)
hey @xsawyerx and all. Thanks for the reply. It ok that this PR wasn't used. I'm glad it did come in handy in some way. I wish it was seen a bit earlier though :/
Anyway, I will have some more free time now and I'm wondering if there are minor patches needed to the documentation as a result of these command line options not being there. I can submit for that to get back on wagon after my little stint of absence.
@gideondsouza I'm going through issues and marking simple issues as "beginner friendly". Feel free to pick them up and work on them. Just write it in the ticket, and ping us with any questions! :)
I think we should close this issue. @racke, @mickeyn, @shumphrey, @veryrusty, etc.?
thanks @xsawyerx I shall be on the lookout 😄
@gideondsouza++ for all the work you did, and the work you promoted. :)
You guys are welcome 💃