Skip to content

Handle root-vs-static index resolution for site entrypoint - #3

Merged
VloStudios merged 1 commit into
mainfrom
copilot/move-index-html-to-root
Sep 15, 2026
Merged

VloStudios merged 1 commit into
mainfrom
copilot/move-index-html-to-root

Conversation

Copilot AI commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

The site failed on hosts expecting index.html at repository root, while the project entrypoint lived under static/. This change makes entrypoint resolution tolerant to both layouts without changing existing static/ deployment behavior.

  • Entrypoint resolution (Flask)

    • Updated / route to prefer /index.html at repo root when present.
    • Preserved fallback to static/index.html when root index is absent.
  • Static-host compatibility

    • Added root index.html as a lightweight redirect to static/index.html so root-only host lookups still load the existing site.
  • Behavioral impact

    • Local/runtime serving now supports both structures: root-index-first with static fallback.
    • Existing assets and static/ site structure remain unchanged.
@app.route('/')
def index():
    root_index = os.path.join(app.root_path, 'index.html')
    if os.path.exists(root_index):
        return send_from_directory(app.root_path, 'index.html')
    return send_from_directory(app.static_folder, 'index.html')

Co-authored-by: VloStudios <198949883+VloStudios@users.noreply.github.com>
@VloStudios
VloStudios requested a lite review from Copilot September 15, 2026 08:03
@VloStudios
VloStudios marked this pull request as ready for review September 15, 2026 08:04
@VloStudios
VloStudios merged commit dfe6730 into main Sep 15, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The requested entrypoint compatibility is implemented without changing the existing static site behavior.

Pull request overview

Adds compatibility for root-level and static/ site entrypoints while preserving existing deployment behavior.

Changes:

  • Serves root index.html first, with a static fallback.
  • Adds a root redirect to static/index.html.
File summaries
File Description
index.html Redirects root-host requests to the static site.
app.py Implements root-first entrypoint resolution.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

3 participants