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

希望可以在代码中手动设定配置文件默认位置 #48

Closed
iKuiki opened this issue Apr 25, 2019 · 3 comments
Closed

希望可以在代码中手动设定配置文件默认位置 #48

iKuiki opened this issue Apr 25, 2019 · 3 comments

Comments

@iKuiki
Copy link

iKuiki commented Apr 25, 2019

刚入手此框架,发现框架对应用的入侵略大

例如,配置文件读取,简单看了下源代码,读取配置时如果没有给定参数,就从AppDir/bin/conf/server.json读取,无法在code时覆盖这个默认路径,就导致要不每次运行都要带上这串参数,要么就用给定的默认config位置,显得有些不灵活了

@liangdas
Copy link
Owner

启动进程的时候 --conf 命令可以指定配置路径

@iKuiki
Copy link
Author

iKuiki commented Apr 26, 2019

启动进程的时候 --conf 命令可以指定配置路径

我知道那样可以,但是某些情况下,是不希望这样指定的,比如跑go test的时候,是不好指定的,特别是在ide里跑的时候
conf包提供了LoadConf的功能,app也支持Configure方法设置配置,为何还要在Run方法中强行在Load一次配置呢
我认为,就算要Load初始配置,也应该是在CreateApp时load,不知是否可以做这样的修改,或者我来修改,提Pull request,您看如何

@liangdas
Copy link
Owner

嗯可以的,你可以修改real分支,我这边会合并,现在我再real分支也倾向用CreateApp传参的形式来做了

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

No branches or pull requests

2 participants