Skip to content

Commit ca2d7b6

Browse files
tomerd0xTim
andauthored
update content-improvments branch per feedback (#244)
motivation: address feedback from content review changes: * slight langauge changes * update vapor guide to be more generic so that we an also point to other web frameworks in the future Co-authored-by: Tim Condon <[email protected]>
1 parent f37fd24 commit ca2d7b6

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

_data/go_further.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
content_url: https://developer.apple.com/videos/play/wwdc2021/10132/
55
thumbnail_url: #TBD
66
release_date: 2021-06-08
7-
- title: "Swift Generics"
7+
- title: "Generics"
88
description: "In Swift, generics are a fundamental way to write abstract code. This video walks through the basics of Swift Generics and introducing generics into your code."
99
content_type: video
1010
content_url: https://developer.apple.com/videos/play/wwdc2021/10132/
@@ -16,7 +16,7 @@
1616
content_url: https://developer.apple.com/videos/play/wwdc2022/110357/
1717
thumbnail_url: #TBD
1818
release_date: 2022-06-07
19-
- title: "Swift Strings Under The Hood"
19+
- title: "Strings Under The Hood"
2020
description: "Swift strings provide a fast, Unicode-compliant way to work with text. This article provides more detail on how strings are implemented in Swift using UTF-8 and the reasons behind that choice."
2121
content_type: article
2222
content_url: /blog/utf8-string/

documentation/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ If you are new to Swift, you may want to check out these additional resources.
77

88
<div class="links links-list-nostyle" markdown="1">
99
- [Getting started guide](/getting-started/)
10-
- [Swift resources at Apple.com](https://developer.apple.com/swift/resources/){:target="_blank" class="link-external"}
10+
- [Swift resources on developer.apple.com](https://developer.apple.com/swift/resources/){:target="_blank" class="link-external"}
1111
</div>
1212

1313
## Swift Language

getting-started/_use-cases.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Looking for a language reference? [The Swift Programming Language (TSPL)](https:
99
<li class="use-case">
1010
<h3>Command-line Tool</h3>
1111
<p class="description">
12-
Build a command-line tool using SwiftPM.
12+
Build a cross-platform command-line tool.
1313
</p>
1414

1515
<a href="/getting-started/cli-swiftpm" class="cta-secondary">Start tutorial</a>
@@ -18,24 +18,24 @@ Looking for a language reference? [The Swift Programming Language (TSPL)](https:
1818
<li class="use-case">
1919
<h3>Library</h3>
2020
<p class="description">
21-
Build a library using SwiftPM.
21+
Build a cross-platform library.
2222
</p>
2323

2424
<a href="/getting-started/library-swiftpm" class="cta-secondary">Start tutorial</a>
2525
</li>
2626

2727
<li class="use-case">
28-
<h3>Web Server with Vapor</h3>
28+
<h3>Web Service</h3>
2929
<p class="description">
30-
Use the open-source Vapor framework to build a web service using SwiftPM.
30+
Use a web framework to build a web service.
3131
Requires macOS or Linux.
3232
</p>
3333

3434
<a href="/getting-started/vapor-web-server" class="cta-secondary">Start tutorial</a>
3535
</li>
3636

3737
<li class="use-case">
38-
<h3>App for Apple platforms</h3>
38+
<h3>iOS and macOS Application</h3>
3939
<p class="description">
4040
Use Swift and SwiftUI to build an app that works on iOS and macOS.
4141
Requires macOS 12 and Xcode 14.

getting-started/vapor-web-server/index.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
---
22
layout: page
3-
title: Build a Web Server with Vapor
3+
title: Build a Web Service with Vapor
44
---
55

66
{% include getting-started/_installing.md %}
77

8+
## Choosing a web framework
9+
10+
Over the years, the Swift community created several web frameworks designed to help building web services.
11+
This guide focuses on the [Vapor](https://vapor.codes) web framework, a popular choice with the community.
12+
813
## Installing Vapor
914

10-
This guide uses the [Vapor](https://vapor.codes) web framework to build a server application. First, you need to install the Vapor toolbox. If you already have Homebrew installed on macOS, run
15+
First, you need to install the Vapor toolbox.
16+
If you already have Homebrew installed on macOS, run
1117

1218
```bash
1319
brew install vapor
@@ -57,7 +63,7 @@ app.get("hello", ":name") { req async throws -> String in
5763
}
5864
```
5965

60-
Here's what the code does:
66+
Here's what the code does:
6167

6268
1. Declare a new route handler registered as a **GET** request to `/hello/<NAME>`. The `:` denotes a dynamic path parameter in Vapor and will match any value and allow you to retrieve it in your route handler. `app.get(...)` takes a closure as the final parameter that can be asynchronous and must return a `Response` or something conforming to `ResponseEncodable`, such as `String`.
6369
2. Get the name from the parameters. By default, this returns a `String`. If you want to extract another type, such as `Int` or `UUID` you can write `req.parameters.require("id", as: UUID.self)` and Vapor will attempt to cast it to the type and automatically throw an error if it's unable to. This throws an error if the route hasn't been registered with the correct parameter name.

index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ atom: true
99
Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns.
1010

1111
<div class="links links-list-nostyle" markdown="1">
12-
- [Get started with Swift](/getting-started)
13-
- [Read the documentation](/documentation)
14-
- [Latest release: 5.7](/download/#swift-57)
12+
- [Latest release: 5.7](/blog/swift-5.7-released)
13+
- [Get started](/getting-started)
14+
- [Read the docs](/documentation)
1515
</div>
1616

1717
## Why Swift?
@@ -57,7 +57,7 @@ No matter how you want to get involved, we ask that you first learn what’s exp
5757
Anyone with a good idea can help shape the future features and direction of the language. To reach the best possible solution to a problem, we discuss and iterate on ideas in a public forum.
5858

5959
<div class="links links-list-nostyle" markdown="1">
60-
- [The Swift Evolution Process](/contributing/#participating-in-the-swift-evolution-process)
60+
- [The Swift Evolution Process](/contributing/#swift-evolution)
6161
</div>
6262

6363
### Code
@@ -84,4 +84,4 @@ Stay up-to-date with the latest in the Swift community.
8484
- [Visit the Swift.org blog](/blog/)
8585
- [Visit the Swift forums](https://forums.swift.org)
8686
- [Follow @Swiftlang on Twitter](https://twitter.com/swiftlang){:target="_blank" class="link-external"}
87-
</div>
87+
</div>

0 commit comments

Comments
 (0)