feat: add cors support.

This commit is contained in:
2022-01-12 19:50:51 +08:00
parent 0f741d9ca8
commit 44b230ed85
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -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);