mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 14:06:36 +08:00
63cd906cfc
- Merge all files inside openflare-server to the repository root directory. - Relocate agent, relay, and flared subprojects from internal/ to internal/apps/. - Combine docker-compose files and update build context paths to root. - Update GitHub workflows and Dockerfiles to refer to new directories and package names. - Rewrite Go package imports across all files. - Resolve database renew test race condition and clean up docs.
27 lines
711 B
Go
27 lines
711 B
Go
// Copyright 2026 Arctel.net
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// Package root registers custom business routes and frontend serving.
|
|
package root
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// RegisterFrontend is a package-level variable overridden by frontend.go when built with embed_frontend.
|
|
var RegisterFrontend = func(_ *gin.Engine) {
|
|
// No-op by default
|
|
}
|
|
|
|
// RegisterRootRoutes registers custom business routes that belong to the root path.
|
|
func RegisterRootRoutes(r *gin.Engine) {
|
|
// 1. Default root routes (/f/:id, /robots.txt, and /swagger/*any)
|
|
RegisterDefaultRootRoutes(r)
|
|
|
|
// 2. Register custom serving
|
|
RegisterCustomRootRoutes(r)
|
|
|
|
// 3. Register frontend serving
|
|
RegisterFrontend(r)
|
|
}
|