docs: 在 README 增加启动后端的两种环境变量加载方式#30
Open
F1sh2712 wants to merge 1 commit intoInvolutionHell:mainfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
在 README 的"启动后端服务"章节增加两种环境变量加载方式的说明。
Why
./mvnw spring-boot:run不会自动读取.env文件,但 README 没有说明启动前如何加载环境变量。新贡献者按 README 走会因为 Java 进程拿不到PGPASSWORD等变量而启动失败:The server requested SCRAM-based authentication, but no password was provided.
Closes #25
How
把"启动后端服务"章节从单一命令扩展为两种方式:
set -a && . ./.env && set +a(macOS / Linux)set -a那一行附了一句简短解释,避免对该 shell 语法不熟的读者困惑。Testing
实测两种方式都能成功启动后端:
set -a && . ./.env && set +a后跑./mvnw spring-boot:run→Started BackendApplicationStarted BackendApplication未启用任何方式直接跑
./mvnw spring-boot:run会复现 SCRAM 认证失败,验证 README 新说明的必要性。