diff --git a/api/lib/src/routes/routes.dart b/api/lib/src/routes/routes.dart index ef4df2b..a97b978 100644 --- a/api/lib/src/routes/routes.dart +++ b/api/lib/src/routes/routes.dart @@ -1,4 +1,5 @@ import 'package:angel3_framework/angel3_framework.dart'; +import 'package:angel3_cors/angel3_cors.dart'; import 'package:file/file.dart'; import 'controllers/auth_controllers.dart' as auth_controllers; import 'controllers/system_controllers.dart' as system_controllers; @@ -20,6 +21,8 @@ AngelConfigurer configureServer(FileSystem fileSystem) { return true; }); + app.fallback(cors()); + // Typically, you want to mount controllers first, after any global middleware. await app.configure(system_controllers.configureServer); await app.configure(auth_controllers.configureServer); diff --git a/api/pubspec.yaml b/api/pubspec.yaml index e7f991c..4b0e7b2 100644 --- a/api/pubspec.yaml +++ b/api/pubspec.yaml @@ -18,6 +18,7 @@ dependencies: logging: ^1.0.0 mailer: ^5.0.2 uuid: ^3.0.5 + angel3_cors: ^4.1.0 neat_cache: path: 3rd_party/neat_cache dev_dependencies: