diff --git a/2.0/docs/fluent/database.md b/2.0/docs/fluent/database.md index bf09e9fa..d3044b7b 100644 --- a/2.0/docs/fluent/database.md +++ b/2.0/docs/fluent/database.md @@ -58,10 +58,10 @@ The above prepare statement results in SQL similar to the following: CREATE TABLE `users` (`id` INTEGER PRIMARY KEY NOT NULL, `name` TEXT NOT NULL, `age` INTEGER NOT NULL) ``` -Once you have created you preparation, add it to the Droplet's prepratations array. +Once you have created you preparation, add it to the Config's prepratations array. ```swift -drop.preparations.append(User.self) +config.preparations.append(User.self) ``` ### Create diff --git a/2.0/docs/fluent/getting-started.md b/2.0/docs/fluent/getting-started.md index cfab396c..40af08a2 100644 --- a/2.0/docs/fluent/getting-started.md +++ b/2.0/docs/fluent/getting-started.md @@ -18,13 +18,23 @@ final class Pet: Model { var name: String var age: Int let storage = Storage() + + init(row: Row) throws { + name = try row.get("name") + age = try row.get("age") + } init(name: String, age: Int) { self.name = name self.age = age } - - ... + + func makeRow() throws -> Row { + var row = Row() + try row.set("name", name) + try row.set("age", age) + return row + } } ``` @@ -82,7 +92,7 @@ You can do this by conforming your model to `Preparation`. extension Pet: Preparation { static func prepare(_ database: Database) throws { try database.create(self) { pets in - pets.id(for: self) + pets.id() pets.string("name") pets.int("age") } @@ -102,15 +112,15 @@ Here we are creating a simple table that will look like this: ### Add to Droplet -Now you can add your model to the Droplet's prearations so the database is prepared when your application boots. +Now you can add your model to the config's prearations so the database is prepared when your application boots. ```swift import Vapor import FluentProvider -let drop = try Droplet() - -drop.preparations.append(Pet.self) +let config = try Config() +config.preparations.append(Pet.self) +let drop = try Droplet(config) ... ``` diff --git a/2.0/docs/getting-started/hello-world.md b/2.0/docs/getting-started/hello-world.md index 7689aece..35921f25 100644 --- a/2.0/docs/getting-started/hello-world.md +++ b/2.0/docs/getting-started/hello-world.md @@ -164,5 +164,5 @@ Some debug messages will be silenced while in the production environment, so mak !!! warning If you compiled your application with `--release`, make sure to add that flag to the `vapor run` command as well. e.g., `vapor run serve --env=production --release`. -For more information on deploying your code, check out the [deploy section](https://docs.vapor.codes/2.0/deploy/nginx/). +For more information on deploying your code, check out the [deploy section](../deploy/nginx.md). diff --git a/2.0/docs/getting-started/xcode.md b/2.0/docs/getting-started/xcode.md index 7d33c894..82b6197a 100644 --- a/2.0/docs/getting-started/xcode.md +++ b/2.0/docs/getting-started/xcode.md @@ -8,6 +8,12 @@ You can build, run, and stop your server from within Xcode, as well as use break To use Xcode, you will first need to generate a `*.xcodeproj` file. +### Select 'Run' + +Make sure after generating your Xcode project that you properly select the executable if you're trying to run your application. + +select 'run' from dropdown + ## Generate Project ### Vapor Toolbox diff --git a/2.0/docs/http/client.md b/2.0/docs/http/client.md index b007730a..c67c338c 100644 --- a/2.0/docs/http/client.md +++ b/2.0/docs/http/client.md @@ -48,7 +48,7 @@ req.formURLEncoded = Node(node: [ "email": "mymail@vapor.codes" ]) -try drop.client.response(to: req) +try drop.client.respond(to: req) ``` ## Re-usable Connection diff --git a/2.0/docs/leaf/provider.md b/2.0/docs/leaf/provider.md index f590c426..2b6466aa 100644 --- a/2.0/docs/leaf/provider.md +++ b/2.0/docs/leaf/provider.md @@ -43,9 +43,8 @@ You can also set the `drop.view` property manually if you want to hardcode your import Vapor import LeafProvider -let drop = try Droplet() - -drop.view = LeafRenderer(viewsDir: drop.viewsDir) +let view = LeafRenderer(viewsDir: drop.viewsDir) +let drop = try Droplet(view: view) ``` ## Done diff --git a/2.0/mkdocs.yml b/2.0/mkdocs.yml index dd0763e0..0943beaf 100644 --- a/2.0/mkdocs.yml +++ b/2.0/mkdocs.yml @@ -73,7 +73,9 @@ pages: - 'Package': 'leaf/package.md' - 'Provider': 'leaf/provider.md' - 'Overview': 'leaf/leaf.md' -- Validation: 'validation/overview.md' +- Validation: + - 'Package': 'validation/package.md' + - 'Overview': 'validation/overview.md' - Node: - 'Package': 'node/package.md' - 'Getting Started': 'node/getting-started.md'