diff --git a/CMakeLists.txt b/CMakeLists.txt index 56ea8495..d240b0ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,3 +4,4 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_dart_utils/cmake" find_package(Dart REQUIRED) set(CMAKE_CXX_STANDARD 11) add_subdirectory(lib/src) +install(TARGETS angel_wings LIBRARY DESTINATION "${CMAKE_CURRENT_LIST_DIR}") diff --git a/example/main.dart b/example/main.dart index e1c45216..4aa16ffc 100644 --- a/example/main.dart +++ b/example/main.dart @@ -7,13 +7,17 @@ import 'package:logging/logging.dart'; import 'package:pretty_logging/pretty_logging.dart'; main() async { - var app = Angel(); + hierarchicalLoggingEnabled = true; + + var logger = Logger.detached('wings') + ..level = Level.ALL + ..onRecord.listen(prettyLog); + var app = Angel(logger: logger); var wings = AngelWings(app); var fs = LocalFileSystem(); var vDir = CachingVirtualDirectory(app, fs, source: fs.currentDirectory, allowDirectoryListing: true); - app.logger = Logger('wings')..onRecord.listen(prettyLog); app.mimeTypeResolver.addExtension('yaml', 'text/x-yaml'); app.get('/', (req, res) => 'WINGS!!!'); @@ -21,9 +25,10 @@ main() async { await req.parseBody(); return req.bodyAsMap; }); + app.fallback(vDir.handleRequest); app.fallback((req, res) => throw AngelHttpException.notFound()); - await wings.startServer(InternetAddress.loopbackIPv6, 3000); + await wings.startServer(InternetAddress.loopbackIPv4, 3000); print('Listening at ${wings.uri}'); } diff --git a/libangel_wings.dylib b/libangel_wings.dylib deleted file mode 120000 index eb7bc46e..00000000 --- a/libangel_wings.dylib +++ /dev/null @@ -1 +0,0 @@ -/Users/thosakwe/Source/Angel/wings/lib/src/libangel_wings.dylib \ No newline at end of file diff --git a/libangel_wings.dylib b/libangel_wings.dylib new file mode 100755 index 00000000..ada89e46 Binary files /dev/null and b/libangel_wings.dylib differ