Skip to content

Commit

Permalink
Update snippet in server.md (#954)
Browse files Browse the repository at this point in the history
Use `makeServerConfiguration` instead of deprecated `forServer`.
  • Loading branch information
valeriyvan committed Dec 13, 2023
1 parent 38d4edd commit fafc8ba
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/advanced/server.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ Der Parameter _tlsConfiguration_ legt fest, ob TLS (SSL) verwendet werden soll.
/// [configure.swift]

// Enable TLS.
try app.http.server.configuration.tlsConfiguration = .forServer(
certificateChain: NIOSSLCertificate.fromPEMFile("/path/to/cert.pem").map { .certificate($0) },
app.http.server.configuration.tlsConfiguration = .makeServerConfiguration(
certificateChain: try NIOSSLCertificate.fromPEMFile("/path/to/cert.pem").map { .certificate($0) },
privateKey: .file("/path/to/key.pem")
)
```
Expand Down
4 changes: 2 additions & 2 deletions docs/advanced/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ The `tlsConfiguration` parameter controls whether TLS (SSL) is enabled on the se

```swift
// Enable TLS.
try app.http.server.configuration.tlsConfiguration = .forServer(
certificateChain: NIOSSLCertificate.fromPEMFile("/path/to/cert.pem").map { .certificate($0) },
app.http.server.configuration.tlsConfiguration = .makeServerConfiguration(
certificateChain: try NIOSSLCertificate.fromPEMFile("/path/to/cert.pem").map { .certificate($0) },
privateKey: .file("/path/to/key.pem")
)
```
Expand Down
4 changes: 2 additions & 2 deletions docs/advanced/server.nl.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ De `tlsConfiguration` parameter regelt of TLS (SSL) is ingeschakeld op de server

```swift
// Schakel TLS in.
try app.http.server.configuration.tlsConfiguration = .forServer(
certificateChain: NIOSSLCertificate.fromPEMFile("/path/to/cert.pem").map { .certificate($0) },
app.http.server.configuration.tlsConfiguration = .makeServerConfiguration(
certificateChain: try NIOSSLCertificate.fromPEMFile("/path/to/cert.pem").map { .certificate($0) },
privateKey: .file("/path/to/key.pem")
)
```
Expand Down
4 changes: 2 additions & 2 deletions docs/advanced/server.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ app.http.server.configuration.supportVersions = [.two]

```swift
// 启用 TLS.
try app.http.server.configuration.tlsConfiguration = .forServer(
certificateChain: NIOSSLCertificate.fromPEMFile("/path/to/cert.pem").map { .certificate($0) },
app.http.server.configuration.tlsConfiguration = .makeServerConfiguration(
certificateChain: try NIOSSLCertificate.fromPEMFile("/path/to/cert.pem").map { .certificate($0) },
privateKey: .file("/path/to/key.pem")
)
```
Expand Down

0 comments on commit fafc8ba

Please sign in to comment.