Skip to content

Add configurable subpath support for UI deployment#34

Merged
dkrizic merged 3 commits intomainfrom
copilot/support-subpath-for-frontend
Jan 23, 2026
Merged

Add configurable subpath support for UI deployment#34
dkrizic merged 3 commits intomainfrom
copilot/support-subpath-for-frontend

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 22, 2026

Enables deploying the UI at arbitrary paths (e.g., /feature, /app/v1) instead of root only.

Changes

Configuration

  • Added SUBPATH environment variable / --subpath CLI flag
  • Subpath normalized on startup (ensures leading /, strips trailing /)

Route Registration

  • registerHandlers() prefixes all routes with configured subpath
  • Affects: /, /features/*, /health

Template Updates

  • index.gohtml: HTMX target uses {{.Subpath}}/features/list
  • features_list.gohtml: Form actions use {{$.Subpath}}/features/{create,update,delete}

Helm Integration

  • values.yaml: Added ui.subpath field
  • ui-configmap.yaml: Exposes SUBPATH environment variable
  • ui-deployment.yaml: Health probe paths dynamically constructed as {{ print (.Values.ui.subpath | default "") "/health" }}

Usage

# values.yaml
ui:
  subpath: /feature
  ingress:
    hosts:
      - paths:
          - path: /feature

Results in UI accessible at /feature/ with health checks at /feature/health.

Testing

Added TestSubpathSupport covering empty subpath, single-level (/feature), multi-level (/app/v1), and 404 behavior for incorrect paths.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /update-job-proxy /update-job-proxy service --proxy-cert /home/REDACTED/work/_temp/runtime-logs/mkcert/rootCA.pem --updater-env NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/dbot-ca.crt 9021231/b085/vet.cfg rg/toolchain@v0.0.1-go1.25.5.linux-amd64/pkg/tool/linux_amd64/link -p crypto/sha1 mpile rg/toolchain@v0.0.1-go1.25.5.linux-amd64/pkg/toosecurity (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-a4a7c9798eb1 -j DROP C_RAIZ_FNMT-RCM_SERVIDORES_SEGUROS.pem rg/toolchain@v0./usr/share/ca-certificates/mozilla/Hongkong_Post_Root_CA_3.crt test /tmp/go-build121git -trimpath /usr/bin/gcc test -e oot_CA_2022.pem gcc /usr/bin/test 374748166136cca8/usr/sbin/iptables c /usr/bin/git test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP /opt/go/bin/test/etc/ssl/certs/ce5e74ef.0 test -e cation_Authority.pem test est ertification_Aut/usr/bin/git git /bin/test test -e CA_v1.pem test /opt/go/bin/test zenpe.com.pem git endabot/../../bi-t test (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Support for subpath</issue_title>
<issue_description>I would like to put the frontend into a subpath like /feature, currently only / works.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 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: dkrizic <1181349+dkrizic@users.noreply.github.com>
@dkrizic dkrizic marked this pull request as ready for review January 22, 2026 23:58
Co-authored-by: dkrizic <1181349+dkrizic@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for frontend in subpath Add configurable subpath support for UI deployment Jan 23, 2026
Copilot AI requested a review from dkrizic January 23, 2026 00:03
@dkrizic dkrizic merged commit 9923ff3 into main Jan 23, 2026
3 checks passed
@dkrizic dkrizic deleted the copilot/support-subpath-for-frontend branch January 23, 2026 00:05
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.

Support for subpath

2 participants