protevus/lib/angel.dart

25 lines
857 B
Dart
Raw Normal View History

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';
2016-12-21 22:05:11 +00:00
import 'package:angel_common/angel_common.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
/// Creates and configures the server instance.
2016-04-29 01:22:53 +00:00
Future<Angel> createServer() async {
/// Passing `startShared` to the constructor allows us to start multiple
/// instances of our application concurrently, listening on a single port.
///
/// This effectively lets us multi-thread the application.
var app = new Angel.custom(startShared);
2016-04-22 02:56:21 +00:00
/// Set up our application, using three plug-ins defined with this project.
2016-06-23 21:54:10 +00:00
await app.configure(configuration.configureServer);
await app.configure(services.configureServer);
await app.configure(routes.configureServer);
2016-04-22 02:56:21 +00:00
return app;
2017-04-11 18:18:52 +00:00
}