feat(fileserver): implement spa support; add spa and index fields to config

This commit is contained in:
yusing
2025-12-20 19:24:39 +08:00
parent 8045477abf
commit 5012c9afab
2 changed files with 30 additions and 4 deletions

View File

@@ -45,7 +45,10 @@ type (
Scheme route.Scheme `json:"scheme,omitempty" swaggertype:"string" enums:"http,https,tcp,udp,fileserver"`
Host string `json:"host,omitempty"`
Port route.Port `json:"port"`
Root string `json:"root,omitempty"`
Root string `json:"root,omitempty"`
SPA bool `json:"spa,omitempty"` // Single-page app mode: serves index for non-existent paths
Index string `json:"index,omitempty"` // Index file to serve for single-page app mode
route.HTTPConfig
PathPatterns []string `json:"path_patterns,omitempty" extensions:"x-nullable"`