mirror of https://github.com/vapor/docs.git
build
This commit is contained in:
parent
2240018eb8
commit
6de57148e5
|
|
@ -304,13 +304,6 @@
|
|||
Edit Package.swift
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#packageswift" title="Package.swift" class="md-nav__link">
|
||||
Package.swift
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
|
|
@ -320,18 +313,12 @@
|
|||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#compile-run" title="Compile & Run" class="md-nav__link">
|
||||
Compile & Run
|
||||
<li class="md-nav__item">
|
||||
<a href="#compile-run-development" title="Compile & Run (Development)" class="md-nav__link">
|
||||
Compile & Run (Development)
|
||||
</a>
|
||||
|
||||
<nav class="md-nav">
|
||||
<ul class="md-nav__list">
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#production" title="Production" class="md-nav__link">
|
||||
|
|
@ -340,16 +327,16 @@
|
|||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<li class="md-nav__item">
|
||||
<a href="#view" title="View" class="md-nav__link">
|
||||
View
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
|
@ -1573,13 +1560,6 @@
|
|||
Edit Package.swift
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#packageswift" title="Package.swift" class="md-nav__link">
|
||||
Package.swift
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
|
|
@ -1589,18 +1569,12 @@
|
|||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#compile-run" title="Compile & Run" class="md-nav__link">
|
||||
Compile & Run
|
||||
<li class="md-nav__item">
|
||||
<a href="#compile-run-development" title="Compile & Run (Development)" class="md-nav__link">
|
||||
Compile & Run (Development)
|
||||
</a>
|
||||
|
||||
<nav class="md-nav">
|
||||
<ul class="md-nav__list">
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#production" title="Production" class="md-nav__link">
|
||||
|
|
@ -1609,16 +1583,16 @@
|
|||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<li class="md-nav__item">
|
||||
<a href="#view" title="View" class="md-nav__link">
|
||||
View
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
|
@ -1637,8 +1611,8 @@
|
|||
|
||||
|
||||
<h1 id="manual-quickstart">Manual Quickstart<a class="headerlink" href="#manual-quickstart" title="Permanent link">¶</a></h1>
|
||||
<p>Learn how to create a Vapor project <em>without</em> the Toolbox using just Swift 3 and the Swift Package Manager.</p>
|
||||
<p>This document assumes that you have Swift 3.1 installed.</p>
|
||||
<p>Learn how to create a Vapor project <em>without</em> the Toolbox using just Swift 3 and the Swift Package Manager (SPM).</p>
|
||||
<p>This document assumes that you have Swift 3.1 installed, if not please refer to <a href="https://swift.org/getting-started/#installing-swift">Swift.org</a> before you can continue.</p>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">Tip</p>
|
||||
<p>If you'd prefer to use the Toolbox, follow the toolbox guide <a href="../hello-world/">here</a>.</p>
|
||||
|
|
@ -1656,7 +1630,7 @@ swift package init --type executable
|
|||
</pre></div>
|
||||
|
||||
|
||||
<p>Your folder should look like this:</p>
|
||||
<p>Your folder structure should look like this:</p>
|
||||
<div class="codehilite"><pre><span></span>├── Package.swift
|
||||
├── Sources
|
||||
│ └── main.swift
|
||||
|
|
@ -1670,9 +1644,10 @@ swift package init --type executable
|
|||
</pre></div>
|
||||
|
||||
|
||||
<p>And add Vapor as a dependency. Here's how your file will look.</p>
|
||||
<h3 id="packageswift">Package.swift<a class="headerlink" href="#packageswift" title="Permanent link">¶</a></h3>
|
||||
<div class="codehilite"><pre><span></span><span class="kd">import</span> <span class="nc">PackageDescription</span>
|
||||
<p>And add Vapor as a dependency. Here's how your <code>Package.swift</code> should look like.</p>
|
||||
<div class="codehilite"><pre><span></span><span class="c1">// swift-tools-version:3.1</span>
|
||||
|
||||
<span class="kd">import</span> <span class="nc">PackageDescription</span>
|
||||
|
||||
<span class="kd">let</span> <span class="nv">package</span> <span class="p">=</span> <span class="n">Package</span><span class="p">(</span>
|
||||
<span class="n">name</span><span class="p">:</span> <span class="s">"Hello"</span><span class="p">,</span>
|
||||
|
|
@ -1691,17 +1666,17 @@ swift package init --type executable
|
|||
<p>A simple hello world:</p>
|
||||
<div class="codehilite"><pre><span></span><span class="kd">import</span> <span class="nc">Vapor</span>
|
||||
|
||||
<span class="kd">let</span> <span class="nv">drop</span> <span class="p">=</span> <span class="n">Droplet</span><span class="p">()</span>
|
||||
<span class="kd">let</span> <span class="nv">drop</span> <span class="p">=</span> <span class="k">try</span> <span class="n">Droplet</span><span class="p">()</span>
|
||||
|
||||
<span class="n">drop</span><span class="p">.</span><span class="kr">get</span><span class="p">(</span><span class="s">"hello"</span><span class="p">)</span> <span class="p">{</span> <span class="n">req</span> <span class="k">in</span>
|
||||
<span class="k">return</span> <span class="s">"Hello Vapor"</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="n">drop</span><span class="p">.</span><span class="n">run</span><span class="p">()</span>
|
||||
<span class="k">try</span> <span class="n">drop</span><span class="p">.</span><span class="n">run</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
|
||||
|
||||
<h2 id="compile-run">Compile & Run<a class="headerlink" href="#compile-run" title="Permanent link">¶</a></h2>
|
||||
<h3 id="compile-run-development">Compile & Run (Development)<a class="headerlink" href="#compile-run-development" title="Permanent link">¶</a></h3>
|
||||
<p>The first <code>build</code> command can take a while to fetch dependencies.</p>
|
||||
<div class="codehilite"><pre><span></span>swift build
|
||||
.build/debug/Hello serve
|
||||
|
|
@ -1719,7 +1694,7 @@ swift package init --type executable
|
|||
</pre></div>
|
||||
|
||||
|
||||
<h2 id="view">View<a class="headerlink" href="#view" title="Permanent link">¶</a></h2>
|
||||
<h3 id="view">View<a class="headerlink" href="#view" title="Permanent link">¶</a></h3>
|
||||
<p>Go to your favorite browser and visit <code>http://localhost:8080/hello</code></p>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1856,7 +1856,7 @@
|
|||
<li><a href="https://github.com/vapor/leaf-provider">Leaf Provider</a>: Leaf provider for Vapor.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="https://github.com/vapor/redbird">Redbird</a>: Pure-Swift Redis client implemented from the original protocol spec..<ul>
|
||||
<li><a href="https://github.com/vapor/redbird">Redis</a>: Pure-Swift Redis client implemented from the original protocol spec.<ul>
|
||||
<li><a href="https://github.com/vapor/redis-provider">Redis Provider</a>: Redis cache provider for Vapor.</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
@ -1879,7 +1879,7 @@
|
|||
</ul>
|
||||
</li>
|
||||
<li><a href="https://github.com/vapor/kitura-provider">Kitura Provider</a>: Use IBM's Kitura HTTP server in Vapor.</li>
|
||||
<li><a href="https://github.com/SwiftyBeaver/SwiftyBeaver-Vapor">SwiftyBeaver</a>: Adds the powerful logging of SwiftyBeaver to Vapor.</li>
|
||||
<li><a href="https://github.com/vapor-community/swiftybeaver-provider">SwiftyBeaver</a>: Adds the powerful logging of SwiftyBeaver to Vapor.</li>
|
||||
<li><a href="https://github.com/matthijs2704/vapor-apns">APNS</a>: Simple APNS Library for Vapor (Swift).</li>
|
||||
<li><a href="https://github.com/mdab121/vapor-fcm">VaporFCM</a>: Simple FCM (iOS + Android Push Notifications) library built for Vapor in Swift.</li>
|
||||
<li><a href="https://github.com/JustinM1/VaporS3Signer">VaporS3Signer</a>: Generate V4 Auth Header/Pre-Signed URL for AWS S3 REST API</li>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue