Some checks failed
Build and Push Multi-Arch Docker Image / build-and-push (push) Failing after 38s
Signed-off-by: Peter Siegmund <developer@mars3142.org>
19 lines
446 B
Dart
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;
|
|
}
|
|
}
|