Created
September 27, 2014 15:29
-
-
Save ThomasLocke/ec0c23bca4b48718782f to your computer and use it in GitHub Desktop.
shelftest.main()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:io'; | |
| import '../lib/routes.dart'; | |
| import 'package:shelf/shelf.dart' as shelf; | |
| import 'package:shelf/shelf_io.dart' as io; | |
| import 'package:shelf_exception_response/exception_response.dart'; | |
| void main() { | |
| final shelf.Handler handler = const shelf.Pipeline() | |
| .addMiddleware(shelf.logRequests()) | |
| .addMiddleware(exceptionResponse()) | |
| .addHandler(routes.handler); | |
| io.serve(handler, InternetAddress.LOOPBACK_IP_V4, 8080).then((server) { | |
| print('Listening on port 8080'); | |
| }).catchError((error) => print(error)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment