config: unify configuration with multi-site support
- Remove mock_content setting (working database loop makes it unnecessary) - Change server.dev_mode to global dev_mode setting for consistency - Update CLI to use cli.site_id and cli.output for scoped configuration - Implement database client for CLI enhance command (complete static site loop) - Update justfile to use INSERTR_DATABASE_PATH environment variable - Enable multi-site architecture: server is site-agnostic, CLI is site-specific - Unified insertr.yaml now supports both server and CLI with minimal config
This commit is contained in:
@@ -35,14 +35,14 @@ func init() {
|
||||
|
||||
// Bind flags to viper
|
||||
viper.BindPFlag("server.port", serveCmd.Flags().Lookup("port"))
|
||||
viper.BindPFlag("server.dev_mode", serveCmd.Flags().Lookup("dev-mode"))
|
||||
viper.BindPFlag("dev_mode", serveCmd.Flags().Lookup("dev-mode"))
|
||||
}
|
||||
|
||||
func runServe(cmd *cobra.Command, args []string) {
|
||||
// Get configuration values
|
||||
port := viper.GetInt("server.port")
|
||||
dbPath := viper.GetString("database.path")
|
||||
devMode := viper.GetBool("server.dev_mode")
|
||||
devMode := viper.GetBool("dev_mode")
|
||||
|
||||
// Initialize database
|
||||
database, err := db.NewDatabase(dbPath)
|
||||
|
||||
Reference in New Issue
Block a user