import 'dart:async'; import 'dart:io'; import 'package:angel_framework/angel_framework.dart'; import 'package:angel_framework/http.dart'; import 'package:angel_markdown/angel_markdown.dart'; import 'package:file/local.dart'; void main() async { var app = await createServer(); var http = AngelHttp(app); var server = await http.startServer(InternetAddress.loopbackIPv4, 3000); print('Listening at http://${server.address.address}:${server.port}'); } Future createServer() async { // Create a new server, and install the Markdown renderer. var app = Angel(); var fs = LocalFileSystem(); await app .configure(markdown(fs.directory('views'), template: (content, locals) { return ''' ${locals['title'] ?? 'Example Site'} - Example Site
$content
'''; })); // Compile a landing page app.get('/', (req, res) => res.render('hello', {'title': 'Welcome'})); return app; }