latest server code
Some checks failed
Build and Push Multi-Arch Docker Image / build-and-push (push) Failing after 38s
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>
This commit is contained in:
18
server/cinema/lib/common/env_module.dart
Normal file
18
server/cinema/lib/common/env_module.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user