From 1ba83706906f8a886e5421bb75e5905cb3b44976 Mon Sep 17 00:00:00 2001 From: Tony Freeman Date: Thu, 28 Jan 2021 01:27:00 +0300 Subject: [PATCH 1/2] [Package] Fork to fiber branch --- Package.swift | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index aa023cb..dd3738a 100644 --- a/Package.swift +++ b/Package.swift @@ -76,6 +76,6 @@ extension Package.Dependency { static func package(name: String, source: Source) -> Package.Dependency { return source == .local ? .package(name: name, path: source.url(/service/for: name)) - : .package(name: name, url: source.url(/service/for: name), .branch("dev")) + : .package(name: name, url: source.url(/service/for: name), .branch("fiber")) } } diff --git a/README.md b/README.md index 0e506dd..73b7ad2 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Key features: ## Package.swift ```swift -.package(url: "https://github.com/swift-stack/web.git", .branch("dev")) +.package(url: "https://github.com/swift-stack/web.git", .branch("fiber")) ``` ### Fast as hell From 829266c9a907a644ef7330e85f6ca345a5803f95 Mon Sep 17 00:00:00 2001 From: Tony Freeman Date: Fri, 20 Aug 2021 01:37:30 +0300 Subject: [PATCH 2/2] [Package] Prepare for github --- Package.swift | 4 ++-- README.md | 6 +++--- Sources/Web/CookieAuthorization.swift | 2 +- Sources/Web/CookieMiddleware.swift | 2 +- Tests/WebTests/CookiesMiddlewareTests.swift | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Package.swift b/Package.swift index dd3738a..ffd7589 100644 --- a/Package.swift +++ b/Package.swift @@ -46,13 +46,13 @@ extension Package.Dependency { enum Source: String { case local, remote, github - static var `default`: Self { .local } + static var `default`: Self { .github } var baseUrl: String { switch self { case .local: return "../" case .remote: return "https://swiftstack.io/" - case .github: return "https://github.com/swift-stack/" + case .github: return "https://github.com/swiftstack/" } } diff --git a/README.md b/README.md index 73b7ad2..c091a3c 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,12 @@ Key features: ## Package.swift ```swift -.package(url: "https://github.com/swift-stack/web.git", .branch("fiber")) +.package(url: "https://github.com/swiftstack/web.git", .branch("fiber")) ``` ### Fast as hell -About 80k rps on `single core` (i7 4gen, docker) using [Fiber](http://github.com/swift-stack/fiber).
+About 80k rps on `single core` (i7 4gen, docker) using [Fiber](http://github.com/swiftstack/fiber).
```bash (docker) wrk -t1 -c128 -d5 http://0.0.0.0:8080/plaintext @@ -102,7 +102,7 @@ extension Application { ### Simple Asynchronous API -All the modules built on top of [Async](http://github.com/swift-stack/async) which allows us to code without callbacks.
+All the modules built on top of [Async](http://github.com/swiftstack/async) which allows us to code without callbacks.
The API is easy to use, easy to read and easy to update to `async/await` in the future. main.swift diff --git a/Sources/Web/CookieAuthorization.swift b/Sources/Web/CookieAuthorization.swift index 3a06ae5..c068e8c 100644 --- a/Sources/Web/CookieAuthorization.swift +++ b/Sources/Web/CookieAuthorization.swift @@ -1,7 +1,7 @@ import class HTTP.Response public final class CookieAuthorization: AuthorizationProtocol, InjectService { - static var userCookieName = "swift-stack-user" + static var userCookieName = "swiftstack-user" let repository: UserRepository diff --git a/Sources/Web/CookieMiddleware.swift b/Sources/Web/CookieMiddleware.swift index 7d886e8..2edeeca 100644 --- a/Sources/Web/CookieMiddleware.swift +++ b/Sources/Web/CookieMiddleware.swift @@ -3,7 +3,7 @@ import struct HTTP.Cookie import struct Foundation.Date public class CookiesMiddleware: Middleware { - public static var cookiesName: String = "swift-stack-cookies" + public static var cookiesName: String = "swiftstack-cookies" public static func chain( with middleware: @escaping (Context) throws -> Void diff --git a/Tests/WebTests/CookiesMiddlewareTests.swift b/Tests/WebTests/CookiesMiddlewareTests.swift index 48cce72..4fa01b9 100644 --- a/Tests/WebTests/CookiesMiddlewareTests.swift +++ b/Tests/WebTests/CookiesMiddlewareTests.swift @@ -44,7 +44,7 @@ class CookiesMiddlewareTests: TestCase { guard let cookie = firstResponse.cookies.first else { return } - expect(cookie.name == "swift-stack-cookies") + expect(cookie.name == "swiftstack-cookies") expect(!cookie.value.isEmpty) let secondRequest = Request(url: "/second", method: .get)