import 'dart:io';
import 'package:yaml/yaml.dart';

class Config {
  final String databaseUrl;
  final String port;

  Config({required this.databaseUrl, required this.port});

  static Future<Config> load() async {
    final file = File('config.yaml');
    final content = await file.readAsString();
    final config = loadYaml(content);

    return Config(
      databaseUrl: config['database']['url'],
      port: config['server']['port'],
    );
  }
}
