From 086edc4fe6cbd3ec9e4b78da0eaee4015c861997 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Wed, 11 Jul 2018 09:44:21 -0400 Subject: [PATCH] Update routes.dart --- lib/src/routes/routes.dart | 4 ++++ 1 file changed, 4 insertions(+) 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);