MCPcopy Create free account
hub / github.com/astercloud/aster / DefaultConfig

Function DefaultConfig

server/config.go:137–214  ·  view source on GitHub ↗

DefaultConfig returns a default configuration for development

()

Source from the content-addressed store, hash-verified

135
136// DefaultConfig returns a default configuration for development
137func DefaultConfig() *Config {
138 return &Config{
139 Host: "0.0.0.0",
140 Port: 8080,
141 Mode: "development",
142 CORS: CORSConfig{
143 Enabled: true,
144 AllowOrigins: []string{"*"},
145 AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH"},
146 AllowHeaders: []string{"Origin", "Content-Type", "Accept", "Authorization", "X-API-Key"},
147 ExposeHeaders: []string{"Content-Length"},
148 AllowCredentials: true,
149 MaxAge: 86400,
150 },
151 Auth: AuthConfig{
152 APIKey: APIKeyConfig{
153 Enabled: false, // Disabled for local development
154 HeaderName: "X-API-Key",
155 Keys: []string{"dev-key-12345"},
156 },
157 JWT: JWTConfig{
158 Enabled: false,
159 Secret: "change-this-secret",
160 Issuer: "aster",
161 Audience: "aster-api",
162 ExpiryMinutes: 60,
163 },
164 },
165 RateLimit: RateLimitConfig{
166 Enabled: true,
167 RequestsPerIP: 100,
168 WindowSize: time.Minute,
169 BurstSize: 20,
170 },
171 Logging: LoggingConfig{
172 Level: "info",
173 Format: "json",
174 Output: "stdout",
175 Structured: true,
176 },
177 Observability: ObservabilityConfig{
178 Enabled: true,
179 Metrics: MetricsConfig{
180 Enabled: true,
181 Endpoint: "/metrics",
182 Port: 9090,
183 },
184 Tracing: TracingConfig{
185 Enabled: false,
186 ServiceName: "aster",
187 ServiceVersion: aster.Version,
188 Environment: "development",
189 OTLPEndpoint: "localhost:4318",
190 OTLPInsecure: true,
191 SamplingRate: 1.0,
192 },
193 HealthCheck: HealthCheckConfig{
194 Enabled: true,

Callers 4

mainFunction · 0.92
NewFunction · 0.70
setupTestServerFunction · 0.70
ProductionConfigFunction · 0.70

Calls

no outgoing calls

Tested by 1

setupTestServerFunction · 0.56