Update angel.dart

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

View file

@ -2,7 +2,6 @@
library angel; library angel;
import 'dart:async'; import 'dart:async';
import 'package:angel_cors/angel_cors.dart';
import 'package:angel_framework/angel_framework.dart'; import 'package:angel_framework/angel_framework.dart';
import 'package:file/local.dart'; import 'package:file/local.dart';
import 'src/config/config.dart' as configuration; import 'src/config/config.dart' as configuration;
@ -11,11 +10,12 @@ import 'src/services/services.dart' as services;
/// Configures the server instance. /// Configures the server instance.
Future configureServer(Angel app) async { Future configureServer(Angel app) async {
// Enable CORS // Grab a handle to the file system, so that we can do things like
app.use(cors()); // serve static files.
var fs = const LocalFileSystem();
// Set up our application, using the plug-ins defined with this project. // Set up our application, using the plug-ins defined with this project.
await app.configure(configuration.configureServer(const LocalFileSystem())); await app.configure(configuration.configureServer(fs));
await app.configure(services.configureServer); await app.configure(services.configureServer);
await app.configure(routes.configureServer(const LocalFileSystem())); await app.configure(routes.configureServer(fs));
} }