Skip to content

Commit

Permalink
Delete File Storage config
Browse files Browse the repository at this point in the history
Update s3 env
  • Loading branch information
javad-zobeidi committed May 31, 2024
1 parent 1dac058 commit 065e078
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
8 changes: 4 additions & 4 deletions lib/src/aws/s3_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class S3Client {
factory S3Client() => _singleton;
S3Client._internal();

final String _region = env<String>('S3_REGION', '');
final String _bucket = env<String>('S3_BUCKET', '');
final String _secretKey = env<String>('S3_SECRET_KEY', '');
final String _accessKey = env<String>('S3_ACCESS_KEY', '');
final String _region = env<String>('STORAGE_S3_REGION', '');
final String _bucket = env<String>('STORAGE_S3_BUCKET', '');
final String _secretKey = env<String>('STORAGE_S3_SECRET_KEY', '');
final String _accessKey = env<String>('STORAGE_S3_ACCESS_KEY', '');

Uri buildUri(String key) {
return Uri.https('$_bucket.s3.$_region.amazonaws.com', '/$key');
Expand Down
12 changes: 0 additions & 12 deletions lib/src/config/config.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'package:vania/vania.dart';

class Config {
static final Config _singleton = Config._internal();
factory Config() => _singleton;
Expand All @@ -11,16 +9,6 @@ class Config {
dynamic get(String key) => _config[key];
}

class FileStorageConfig {
final String defaultDriver;
final Map<String, StorageDriver> drivers;

const FileStorageConfig({
this.defaultDriver = 'file',
this.drivers = const <String, StorageDriver>{},
});
}

class CORSConfig {
final bool enabled;
final dynamic origin;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/route/middleware/throttle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ class Throttle extends Middleware {
code: HttpStatus.tooManyRequests,
);
}
next?.handle(req);
return await next?.handle(req);
}
}
2 changes: 1 addition & 1 deletion lib/src/storage/storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Storage {

static Future<String> put(String directory, String file, dynamic content) {
if (content == null) {
throw Exception("Content can't bew null");
throw Exception("Content can't be null");
}

if (!(content is List<int> || content is String)) {
Expand Down

0 comments on commit 065e078

Please sign in to comment.