From bdfe20513669e0a1f5ac0a6007f17fdff1feeacb Mon Sep 17 00:00:00 2001 From: Tobe O Date: Wed, 11 Jul 2018 09:45:47 -0400 Subject: [PATCH] Update routes.dart --- lib/src/routes/routes.dart | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/src/routes/routes.dart b/lib/src/routes/routes.dart index 3eb9132..44855b2 100644 --- a/lib/src/routes/routes.dart +++ b/lib/src/routes/routes.dart @@ -33,12 +33,14 @@ AngelConfigurer configureServer(FileSystem fileSystem) { // Read the following two sources for documentation: // * https://medium.com/the-angel-framework/serving-static-files-with-the-angel-framework-2ddc7a2b84ae // * https://github.com/angel-dart/static - var vDir = new VirtualDirectory( - app, - fileSystem, - source: fileSystem.directory('web'), - ); - app.use(vDir.handleRequest); + if (!app.isProduction) { + var vDir = new VirtualDirectory( + app, + fileSystem, + source: fileSystem.directory('web'), + ); + app.use(vDir.handleRequest); + } // Throw a 404 if no route matched the request. app.use(() => throw new AngelHttpException.notFound());