* Add documentation about creating custom middleware
I tried to explain how to do an action before the handler and after. I'm not quite sure about the syntax here: `if req.auth.require().role != "admin" {` so I'll be glad if someone can double-check it 🙏
* Apply suggestions from code review
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
* Update 4.0/docs/middleware.md
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
* Add redirection example
This tries to fix#563. I put it in `routing.md` for now, but I think there should be a documentation page for `Request` and another one for `Response`
* Update 4.0/docs/routing.md
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
* Update routing.md
* Update routing.md
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
* Add example to use MySQL in local without SSL
* Update 4.0/docs/fluent/overview.md
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
* Update 4.0/docs/fluent/overview.md
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
* Created transaction documentation
Added documentation for the transaction syntax, based on the 3.0 documentation and current implementation.
Added the Star model as example model, as it is used throughout the Fluent examples.
* Apply suggestions from code review
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
I ran into an issue where `PRAGMA foreign_keys = ON` was required on the database itself. I was unaware of this, as it worked for Vapor. I added a tip containing problems that can occur when querying the database directly.
* added small tip regarding query params
* Implemented @0xTim suggestions
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
The example in authentication -> Fluent first establishes code that checks wether a user’s password is at least 8 characters long, and then uses a 6 character password in the example. This is not a huge problem, but it might present a stumbling block for readers who didn’t pay close attention to the code.
* Update references to `app.swift`
When performing `vapor new hello -n` command as part of [Getting Started](https://docs.vapor.codes/4.0/hello-world/), an `app.swift` file is not generated. The code that creates and runs the `app` lives in `main.swift`. This updates the documentation to reflect this.
* Moved reference to `main.swift` file under "Run"
Created a `### Run` heading, moving the information about `main.swift` under there to match the folder structure on disk.
* Add Custom Working Dir page
Add a page with images explaining how to set a custom working directory in Xcode.
* Fix “Xcode” spelling
* Move custom working dir doc to Xcode section
* Add section intro and change formatting.
* Update xcode.md
Co-authored-by: Tanner <me@tanner.xyz>