diff --git a/lib/src/routes/routes.dart b/lib/src/routes/routes.dart index c816f8a..dba8965 100644 --- a/lib/src/routes/routes.dart +++ b/lib/src/routes/routes.dart @@ -1,6 +1,7 @@ /// This app's route configuration. library angel.src.routes; +import 'package:angel_cors/angel_cors.dart'; import 'package:angel_framework/angel_framework.dart'; import 'package:angel_static/angel_static.dart'; import 'package:file/file.dart'; @@ -13,6 +14,9 @@ import 'controllers/controllers.dart' as controllers; /// * https://github.com/angel-dart/angel/wiki/Requests-&-Responses AngelConfigurer configureServer(FileSystem fileSystem) { return (Angel app) async { + // Enable CORS + app.use(cors()); + // Typically, you want to mount controllers first, after any global middleware. await app.configure(controllers.configureServer);