mirror of https://github.com/vapor/docs.git
updates
This commit is contained in:
parent
0c0738b5ea
commit
87bf399ffe
|
|
@ -20,12 +20,12 @@ menu:
|
|||
getting-started-install-toolbox:
|
||||
text: Install Toolbox
|
||||
relativeUrl: getting-started/install-toolbox.html
|
||||
getting-started-manual:
|
||||
text: Manual
|
||||
relativeUrl: getting-started/manual.html
|
||||
getting-started-hello-world:
|
||||
text: Hello, World
|
||||
relativeUrl: getting-started/hello-world.html
|
||||
getting-started-manual:
|
||||
text: Manual
|
||||
relativeUrl: getting-started/manual.html
|
||||
getting-started-xcode:
|
||||
text: Xcode
|
||||
relativeUrl: getting-started/xcode.html
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Search GitHub for:
|
|||
- [Fluent Drivers](https://github.com/vapor?utf8=✓&query=-driver)
|
||||
- [Vapor Providers](https://github.com/vapor?utf8=✓&query=-provider)
|
||||
|
||||
Not all drivers have providers yet, and not all drivers or providers are up to date with the latest Vapor 0.18. This is a great way to contribute!
|
||||
Not all drivers have providers yet, and not all drivers or providers are up to date with the latest Vapor 1.0. This is a great way to contribute!
|
||||
|
||||
## Creating a Driver
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ currentMenu: getting-started-hello-world
|
|||
|
||||
This section assumes you have installed Swift 3 and the Vapor Toolbox and have verified they are working.
|
||||
|
||||
> Note: If you don't want to use the Toolbox, follow the [manual guide](manual.md).
|
||||
|
||||
## New Project
|
||||
|
||||
Let's start by creating a new project called Hello, World
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ Vapor's command line interface provides shortcuts and assistance for commons tas
|
|||
|
||||
> If you do not want to install the Toolbox, checkout the [Manual](manual.md) quickstart.
|
||||
|
||||
## Install
|
||||
### Install
|
||||
|
||||
Run the following script to install the [Toolbox](https://github.com/vapor/toolbox).
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ curl -sL toolbox.vapor.sh | bash
|
|||
|
||||
> Note: You must have the correct version of Swift 3 installed.
|
||||
|
||||
## Verify
|
||||
### Verify
|
||||
|
||||
Make sure the Toolbox installed successfully by running the help query. You should see a print out of the available commands. You can run the `--help` option on any Toolbox command.
|
||||
|
||||
|
|
@ -28,10 +28,14 @@ Make sure the Toolbox installed successfully by running the help query. You shou
|
|||
vapor --help
|
||||
```
|
||||
|
||||
## Updating
|
||||
### Updating
|
||||
|
||||
The toolbox can update itself. This may be useful if you experience any issues in the future.
|
||||
|
||||
```sh
|
||||
vapor self update
|
||||
```
|
||||
```
|
||||
|
||||
## Create A Project
|
||||
|
||||
Now that you have installed the Toolbox, you can create your first Vapor project following the [Hello, World guide](hello-world.md).
|
||||
|
|
@ -4,11 +4,13 @@ currentMenu: getting-started-manual
|
|||
|
||||
# Manual Quickstart
|
||||
|
||||
Learn how to create a Vapor project without the Vapor Toolbox using just Swift 3 and the Swift Package Manager.
|
||||
Learn how to create a Vapor project _without_ the Toolbox using just Swift 3 and the Swift Package Manager.
|
||||
|
||||
> If you'd prefer to use the toolbox, learn how to install it [here](install-toolbox.md).
|
||||
> If you'd prefer to use the Toolbox, learn how to install it [here](install-toolbox.md).
|
||||
|
||||
This document assumes that the appropriate version of Swift is installed for Vapor 0.18.
|
||||
This document assumes that you have Swift 3 installed.
|
||||
|
||||
> Note: If you've installed the Toolbox, follow the toolbox guide [here](hello-world.md).
|
||||
|
||||
## Check
|
||||
|
||||
|
|
|
|||
|
|
@ -24,10 +24,26 @@ final class VersionMiddleware: Middleware {
|
|||
}
|
||||
```
|
||||
|
||||
We then add this middleware to our `Droplet`.
|
||||
We then supply this middleware to our `Droplet`.
|
||||
|
||||
```swift
|
||||
drop.middleware.append(VersionMiddleware())
|
||||
let drop = Droplet(availableMiddleware: [
|
||||
"version": VersionMiddleware()
|
||||
])
|
||||
```
|
||||
|
||||
## Middleware.json
|
||||
|
||||
Once the middleware has been supplied, enable it in your `Config/middleware.json` file.
|
||||
|
||||
```json
|
||||
{
|
||||
"server": [
|
||||
...
|
||||
"version"
|
||||
],
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
You can imagine our `VersionMiddleware` sitting in the middle of a chain that connects the client and our server. Every request and response that hits our server must go through this chain of middleware.
|
||||
|
|
|
|||
Loading…
Reference in New Issue