refactor: split backend into standalone server project

Remove embedded frontend and workflow editor assets, add standalone API deployment configuration, and retain the current backend service updates.
This commit is contained in:
t
2026-08-20 21:46:55 +08:00
parent 954a3fe8d9
commit 3d47227fbd
612 changed files with 515 additions and 97334 deletions
+10 -2
View File
@@ -42,8 +42,9 @@ type WxWorkNotifyConfig struct {
}
type ServerConfig struct {
Port int `yaml:"port"`
CORS CORSConfig `yaml:"cors"`
Port int `yaml:"port"`
FrontendURL string `yaml:"frontendUrl"`
CORS CORSConfig `yaml:"cors"`
}
func (s ServerConfig) Address() string {
@@ -53,6 +54,13 @@ func (s ServerConfig) Address() string {
return fmt.Sprintf(":%d", s.Port)
}
func (s ServerConfig) FrontendBaseURL() string {
if value := strings.TrimRight(strings.TrimSpace(s.FrontendURL), "/"); value != "" {
return value
}
return "http://127.0.0.1:3000"
}
type CORSConfig struct {
// AllowedOrigins 是允许浏览器跨域访问的 Origin 白名单,必须包含协议和域名。
// 留空表示不允许跨域请求;同源请求通常不会携带 Origin,不受影响。