From ab848a09a3b7590865190d8608b946e8f49018a5 Mon Sep 17 00:00:00 2001 From: Logan Wright Date: Mon, 1 Aug 2016 14:25:56 -0400 Subject: [PATCH 1/2] manual quickstart --- getting-started/quickstart.md | 89 +++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 getting-started/quickstart.md diff --git a/getting-started/quickstart.md b/getting-started/quickstart.md new file mode 100644 index 00000000..c7bae5f7 --- /dev/null +++ b/getting-started/quickstart.md @@ -0,0 +1,89 @@ +--- +currentMenu: getting-started-quick-start +--- + +# Vapor Quickstart + +This document assumes that the appropriate version of Swift is installed for Vapor. Right now, this is visible on the [vapor](https://github.com/qutheory/vapor#-environment) section of the repository. + +You can run the following to check compatibility: + +```bash +curl -sL check.qutheory.io | bash +``` + +## Make new project using SwiftPM + +Open your terminal + +> For our example, we'll be using the Desktop folder. + +```bash +cd ~/Desktop +mkdir HelloVapor +cd HelloVapor +swift package init --type executable +``` + +Your folder should look like this: + +``` +├── Package.swift +├── Sources +│   └── main.swift +└── Tests +``` + +## Edit `Package.swift` + +Open your `Package.swift` file: + +```bash +open Package.swift +``` + +And add Vapor as a dependency. Here's how your file will look. + +#### Package.swift + +```Swift +import PackageDescription + +let package = Package( + name: "HelloVapor", + dependencies: [ + .Package(url: "https://github.com/qutheory/vapor.git", majorVersion: 0, minor: 15) + ] +) +``` + +## Edit `main.swift` + +A simple hello world: + +``` +import Vapor + +let drop = Droplet() + +drop.get("/hello") { _ in + return "Hello Vapor" +} + +try drop.serve() +``` + +## Build and Run + +The first `build` command can take a while to fetch dependencies. + +``` +swift build +.build/debug/HelloVapor +``` + +> If different, replace `HelloVapor` above with the name of your executable. + +## View + +Go to your favorite browser and visit `http://localhost:8000/hello` From 6f149ba8b21cfa07f001ad2399e8c4b6ee0a9ed8 Mon Sep 17 00:00:00 2001 From: Logan Wright Date: Tue, 2 Aug 2016 12:54:17 -0400 Subject: [PATCH 2/2] update --- getting-started/quickstart.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/getting-started/quickstart.md b/getting-started/quickstart.md index c7bae5f7..0c20ae7d 100644 --- a/getting-started/quickstart.md +++ b/getting-started/quickstart.md @@ -12,6 +12,8 @@ You can run the following to check compatibility: curl -sL check.qutheory.io | bash ``` +> If you'd prefer to use our built in tool, you can find information [here](install-toolbox.md) + ## Make new project using SwiftPM Open your terminal @@ -57,6 +59,8 @@ let package = Package( ) ``` +> We try to keep this document up to date, however, you can view latest releases [here](https://github.com/qutheory/vapor/releases) + ## Edit `main.swift` A simple hello world: