Files
cinema-display/server/cinema/lib/common/env_module.dart
Peter Siegmund 4defe266eb
Some checks failed
Build and Push Multi-Arch Docker Image / build-and-push (push) Failing after 38s
latest server code
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2025-11-28 21:02:02 +01:00

19 lines
446 B
Dart

import 'dart:io';
import 'package:injectable/injectable.dart';
import 'package:cinema/common/env_not_found_exception.dart';
const apiKey = "apiKey";
@module
abstract class EnvModule {
@lazySingleton
@Named(apiKey)
String get api_key {
final key = Platform.environment['TMDB_API_KEY'];
if (key == null || key.isEmpty) {
throw EnvNotFoundException('TMDB_API_KEY environment variable is missing.');
}
return key;
}
}