Update routes.dart

This commit is contained in:
Tobe O 2018-07-11 09:44:21 -04:00 committed by GitHub
parent 30f823be2a
commit 086edc4fe6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);