From cedc9e55ce49231f397ca70ad8762695e144d3e8 Mon Sep 17 00:00:00 2001 From: bellebethcooper Date: Sun, 6 Jan 2019 08:59:34 +1100 Subject: [PATCH] Add mention of the need to enable FileMiddleware Related to this issue: https://github.com/vapor/vapor/issues/1629#issuecomment-451648426 --- 3.0/docs/getting-started/structure.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/3.0/docs/getting-started/structure.md b/3.0/docs/getting-started/structure.md index 6b060850..7c8519ca 100644 --- a/3.0/docs/getting-started/structure.md +++ b/3.0/docs/getting-started/structure.md @@ -38,6 +38,10 @@ the file immediately. For example, a request to `localhost:8080/favicon.ico` will check to see if `Public/favicon.ico` exists. If it does, Vapor will return it. +You will need to enable `FileMiddleware` in your `configure.swift` file before Vapor can return public files. Make sure you've uncommented this line: + +`middlewares.use(FileMiddleware.self)` + ## Sources This folder contains all of the Swift source files for your project. @@ -96,4 +100,4 @@ Learn more about testing in [Testing → Getting Started](../testing/getting- ## Package.swift -Finally is SPM's [package manifest](spm.md#package-manifest). \ No newline at end of file +Finally is SPM's [package manifest](spm.md#package-manifest).