Update app configuration and plugin manager for improved environment variable support

- Modify app configuration to use environment variables for base URL and API key, enhancing flexibility for different environments.
- Refactor plugin installation logic in the PluginManager to ensure proper configuration object structure.
- Update base module initialization to correctly access Nostr relay options from the configuration, improving reliability.
This commit is contained in:
padreug 2025-09-05 00:17:11 +02:00
parent e40ac91417
commit c692664c93
3 changed files with 4 additions and 4 deletions

View file

@ -55,8 +55,8 @@ export const appConfig: AppConfig = {
lazy: false, lazy: false,
config: { config: {
apiConfig: { apiConfig: {
baseUrl: 'http://lnbits', baseUrl: import.meta.env.VITE_LNBITS_BASE_URL || 'http://localhost:5000',
apiKey: 'your-api-key-here' apiKey: import.meta.env.VITE_API_KEY || ''
}, },
ticketValidationEndpoint: '/api/tickets/validate', ticketValidationEndpoint: '/api/tickets/validate',
maxTicketsPerUser: 10 maxTicketsPerUser: 10

View file

@ -96,7 +96,7 @@ export class PluginManager {
throw new Error('Plugin manager not initialized') throw new Error('Plugin manager not initialized')
} }
await plugin.install(this.app, config.config) await plugin.install(this.app, { config: config.config })
// Register routes if provided // Register routes if provided
if (plugin.routes && this.router) { if (plugin.routes && this.router) {

View file

@ -32,7 +32,7 @@ export const baseModule: ModulePlugin = {
container.provide('pwaService', pwaService) container.provide('pwaService', pwaService)
// Initialize core services // Initialize core services
await relayHub.initialize(options?.nostr?.relays || []) await relayHub.initialize(options?.config?.nostr?.relays || [])
await auth.initialize() await auth.initialize()
console.log('✅ Base module installed successfully') console.log('✅ Base module installed successfully')