-
-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more info about favicon.ico. #897
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,35 @@ let fileMiddleware = FileMiddleware( | |
app.middleware.use(fileMiddleware) | ||
``` | ||
|
||
If running from Xcode please set the project schema run option working directory. | ||
See [here](https://docs.vapor.codes/getting-started/xcode/#custom-working-directory) for more information. | ||
|
||
To see the `favicon.ico` in action prepare a route in `/Sources/App/routes.swift` like this: | ||
|
||
```swift | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While I agree that the current docs are pretty unhelpful. I think it might be better to change the existing favicon.ico example to be a different type of file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
import Vapor | ||
|
||
func routes(_ app: Application) throws { | ||
app.get { req async in | ||
Response( | ||
status: .ok, | ||
headers: ["Content-Type": "text/html"], | ||
body: | ||
""" | ||
<html> | ||
<head> | ||
<link rel="shortcut icon" href="/favicon.ico"> | ||
</head> | ||
<body> | ||
It works! | ||
</body> | ||
</html> | ||
""" | ||
) | ||
} | ||
} | ||
``` | ||
|
||
## Sources | ||
|
||
This folder contains all of the Swift source files for your project. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to use an 'local' link to another markdown file, not an absolute link. The current link doesn't work with localization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 02e694e.