feat: implement auto-injection of insertr.js with site-specific configuration
• Add /insertr.js endpoint to serve JavaScript library from API server • Implement demo gate auto-injection for sites without existing gates • Add dynamic site ID injection using per-demo configuration files • Fix CORS middleware to support localhost origins on any port • Update demo commands to use individual insertr.yaml configs • Resolve content persistence issues by matching site IDs between injection and enhancement • Enable complete edit/save workflow for demo sites with proper namespace isolation
This commit is contained in:
@@ -141,6 +141,9 @@ func runServe(cmd *cobra.Command, args []string) {
|
||||
// Site enhancement endpoint
|
||||
apiRouter.HandleFunc("/enhance", contentHandler.EnhanceSite).Methods("POST")
|
||||
|
||||
// Static library serving (for demo sites)
|
||||
router.HandleFunc("/insertr.js", contentHandler.ServeInsertrJS).Methods("GET")
|
||||
|
||||
// Handle CORS preflight requests explicitly
|
||||
contentRouter.HandleFunc("/{id}", api.CORSPreflightHandler).Methods("OPTIONS")
|
||||
contentRouter.HandleFunc("", api.CORSPreflightHandler).Methods("OPTIONS")
|
||||
|
||||
Reference in New Issue
Block a user