Skip to content

Implement STATIC_PATH environment variable fallback for static file serving - #44

Merged
JonasGao merged 2 commits into
mainfrom
copilot/fix-missing-static-path-logic
Dec 19, 2025
Merged

JonasGao merged 2 commits into
mainfrom
copilot/fix-missing-static-path-logic

Conversation

Copilot AI commented Dec 18, 2025 •

Copy link
Copy Markdown
Contributor

The static file serving configuration was only reading from the YAML config file, ignoring the documented STATIC_PATH environment variable.

Changes

  • config/config.go: Added fallback to STATIC_PATH environment variable when YAML static_path is blank
  • main.go: Added info log when static path remains unconfigured after both checks

Behavior

Priority: YAML config > STATIC_PATH env var > blank (with info log)

When static_path is blank in config.yaml:

// Reads from os.Getenv("STATIC_PATH")
cfg.StaticPath = os.Getenv("STATIC_PATH")

When both are blank:

Info: Static path not configured, static file serving disabled
Original prompt

fix missing "STATIC_PATH" logic:

  1. read config from yaml file
  2. if static path of config is blank, try read STATIC_PATH
  3. if static path still blank, print a info log

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: JonasGao <4549584+JonasGao@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing static path logic in configuration Implement STATIC_PATH environment variable fallback for static file serving Dec 18, 2025
Copilot AI requested a review from JonasGao December 18, 2025 11:44
@JonasGao
JonasGao marked this pull request as ready for review December 19, 2025 03:51
@JonasGao
JonasGao merged commit 119b50a into main Dec 19, 2025
@JonasGao
JonasGao deleted the copilot/fix-missing-static-path-logic branch December 19, 2025 03:52
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.

2 participants