Update routes.dart
This commit is contained in:
parent
367ea1eb36
commit
bdfe205136
1 changed files with 8 additions and 6 deletions
|
@ -33,12 +33,14 @@ AngelConfigurer configureServer(FileSystem fileSystem) {
|
||||||
// Read the following two sources for documentation:
|
// Read the following two sources for documentation:
|
||||||
// * https://medium.com/the-angel-framework/serving-static-files-with-the-angel-framework-2ddc7a2b84ae
|
// * https://medium.com/the-angel-framework/serving-static-files-with-the-angel-framework-2ddc7a2b84ae
|
||||||
// * https://github.com/angel-dart/static
|
// * https://github.com/angel-dart/static
|
||||||
var vDir = new VirtualDirectory(
|
if (!app.isProduction) {
|
||||||
app,
|
var vDir = new VirtualDirectory(
|
||||||
fileSystem,
|
app,
|
||||||
source: fileSystem.directory('web'),
|
fileSystem,
|
||||||
);
|
source: fileSystem.directory('web'),
|
||||||
app.use(vDir.handleRequest);
|
);
|
||||||
|
app.use(vDir.handleRequest);
|
||||||
|
}
|
||||||
|
|
||||||
// Throw a 404 if no route matched the request.
|
// Throw a 404 if no route matched the request.
|
||||||
app.use(() => throw new AngelHttpException.notFound());
|
app.use(() => throw new AngelHttpException.notFound());
|
||||||
|
|
Loading…
Reference in a new issue