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());