2016-04-22 02:56:21 +00:00
|
|
|
/// Your very own web application!
|
|
|
|
library angel;
|
|
|
|
|
2016-04-29 01:22:53 +00:00
|
|
|
import 'dart:async';
|
2017-10-19 21:53:33 +00:00
|
|
|
import 'package:angel_cors/angel_cors.dart';
|
|
|
|
import 'package:angel_framework/angel_framework.dart';
|
|
|
|
import 'package:file/local.dart';
|
2016-06-23 21:54:10 +00:00
|
|
|
import 'src/config/config.dart' as configuration;
|
|
|
|
import 'src/routes/routes.dart' as routes;
|
|
|
|
import 'src/services/services.dart' as services;
|
2016-04-22 02:56:21 +00:00
|
|
|
|
2017-10-19 21:53:33 +00:00
|
|
|
/// Configures the server instance.
|
|
|
|
Future configureServer(Angel app) async {
|
|
|
|
// Enable CORS
|
|
|
|
app.use(cors());
|
2016-04-22 02:56:21 +00:00
|
|
|
|
2017-10-19 21:53:33 +00:00
|
|
|
// Set up our application, using the plug-ins defined with this project.
|
|
|
|
await app.configure(configuration.configureServer(const LocalFileSystem()));
|
2016-06-23 21:54:10 +00:00
|
|
|
await app.configure(services.configureServer);
|
2017-10-19 21:53:33 +00:00
|
|
|
await app.configure(routes.configureServer(const LocalFileSystem()));
|
2017-04-11 18:18:52 +00:00
|
|
|
}
|