feat(backend): implement database schema, models, and import workflow
- Add ProxyHost, CaddyConfig, RemoteServer, SSL, AccessList, User, Setting, ImportSession models - Implement ProxyHostService and RemoteServerService with domain/name uniqueness validation - Add Caddyfile import handler with conflict detection and user review workflow - Create ProxyHostHandler and RemoteServerHandler with full CRUD operations - Wire up Gin/GORM/SQLite dependencies and create missing internal packages - Add database connection layer, server routing, and version info - Update routes to register all new handlers and auto-migrate models - Configure import environment variables and mount points Addresses Issue #5 (data persistence) and Issue #43 (remote servers) Backend now compiles cleanly with go build
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// NewRouter creates a new Gin router with frontend static file serving.
|
||||
func NewRouter(frontendDir string) *gin.Engine {
|
||||
router := gin.Default()
|
||||
|
||||
// Serve frontend static files
|
||||
if frontendDir != "" {
|
||||
router.Static("/assets", frontendDir+"/assets")
|
||||
router.StaticFile("/", frontendDir+"/index.html")
|
||||
router.NoRoute(func(c *gin.Context) {
|
||||
c.File(frontendDir + "/index.html")
|
||||
})
|
||||
}
|
||||
|
||||
return router
|
||||
}
|
||||
Reference in New Issue
Block a user