-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a Provider, unsafeVariable and other improvments
- Loading branch information
Showing
10 changed files
with
394 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "Console", | ||
"repositoryURL": "https://github.com/vapor/console.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "d6cf07af59ae63cd95c4b5f98cf1f25627750fd1", | ||
"version": "3.1.0" | ||
} | ||
}, | ||
{ | ||
"package": "Core", | ||
"repositoryURL": "https://github.com/vapor/core.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "439d6dcd6c520451ae30d39b2ca9f2aba96c22f4", | ||
"version": "3.7.0" | ||
} | ||
}, | ||
{ | ||
"package": "Crypto", | ||
"repositoryURL": "https://github.com/vapor/crypto.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "45bb12d13cdec80dbd1cc0685ea002e51ab83439", | ||
"version": "3.3.2" | ||
} | ||
}, | ||
{ | ||
"package": "DatabaseKit", | ||
"repositoryURL": "https://github.com/vapor/database-kit.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "8f352c8e66dab301ab9bfef912a01ce1361ba1e4", | ||
"version": "1.3.3" | ||
} | ||
}, | ||
{ | ||
"package": "HTTP", | ||
"repositoryURL": "https://github.com/vapor/http.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "b57005e0de30ba36372ac41bfce1ac12b2bc3272", | ||
"version": "3.1.8" | ||
} | ||
}, | ||
{ | ||
"package": "Multipart", | ||
"repositoryURL": "https://github.com/vapor/multipart.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "bd7736c5f28e48ed8b683dcc9df3dcd346064c2b", | ||
"version": "3.0.3" | ||
} | ||
}, | ||
{ | ||
"package": "Routing", | ||
"repositoryURL": "https://github.com/vapor/routing.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "626190ddd2bd9f967743b60ba6adaf90bbd2651c", | ||
"version": "3.0.2" | ||
} | ||
}, | ||
{ | ||
"package": "Service", | ||
"repositoryURL": "https://github.com/vapor/service.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "4907311d7d7f609365982fa302b8b17ffdeb46da", | ||
"version": "1.0.1" | ||
} | ||
}, | ||
{ | ||
"package": "swift-nio", | ||
"repositoryURL": "https://github.com/apple/swift-nio.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "87dbd0216c47ea2e7ddb1b545271b716e03b943e", | ||
"version": "1.13.1" | ||
} | ||
}, | ||
{ | ||
"package": "swift-nio-ssl", | ||
"repositoryURL": "https://github.com/apple/swift-nio-ssl.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "0f3999f3e3c359cc74480c292644c3419e44a12f", | ||
"version": "1.4.0" | ||
} | ||
}, | ||
{ | ||
"package": "swift-nio-ssl-support", | ||
"repositoryURL": "https://github.com/apple/swift-nio-ssl-support.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "c02eec4e0e6d351cd092938cf44195a8e669f555", | ||
"version": "1.0.0" | ||
} | ||
}, | ||
{ | ||
"package": "swift-nio-zlib-support", | ||
"repositoryURL": "https://github.com/apple/swift-nio-zlib-support.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "37760e9a52030bb9011972c5213c3350fa9d41fd", | ||
"version": "1.0.0" | ||
} | ||
}, | ||
{ | ||
"package": "TemplateKit", | ||
"repositoryURL": "https://github.com/vapor/template-kit.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "aff2d6fc65bfd04579b0201b31a8d6720239c1cf", | ||
"version": "1.1.1" | ||
} | ||
}, | ||
{ | ||
"package": "URLEncodedForm", | ||
"repositoryURL": "https://github.com/vapor/url-encoded-form.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "932024f363ee5ff59059cf7d67194a1c271d3d0c", | ||
"version": "1.0.5" | ||
} | ||
}, | ||
{ | ||
"package": "Validation", | ||
"repositoryURL": "https://github.com/vapor/validation.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "4de213cf319b694e4ce19e5339592601d4dd3ff6", | ||
"version": "2.1.1" | ||
} | ||
}, | ||
{ | ||
"package": "Vapor", | ||
"repositoryURL": "https://github.com/vapor/vapor", | ||
"state": { | ||
"branch": null, | ||
"revision": "c86ada59b31c69f08a6abd4f776537cba48d5df6", | ||
"version": "3.3.0" | ||
} | ||
}, | ||
{ | ||
"package": "WebSocket", | ||
"repositoryURL": "https://github.com/vapor/websocket.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "21eb4773e25a8ff96fe347a31fe106900a69fa6a", | ||
"version": "1.1.1" | ||
} | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
|
||
struct HTMLDocument: StaticView { | ||
|
||
let content: CompiledTemplate | ||
|
||
func build() -> CompiledTemplate { | ||
return [ | ||
doctype("html"), | ||
content | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// HTMLTemplateConfig.swift | ||
// HTMLKit | ||
// | ||
// Created by Mats Mollestad on 11/03/2019. | ||
// | ||
|
||
import Service | ||
|
||
extension HTMLRenderer: Service {} | ||
|
||
/// A provider for the HTMLKit Library | ||
public final class HTMLKitProvider: Provider { | ||
|
||
public init() {} | ||
|
||
public func register(_ services: inout Services) throws { | ||
services.register { (container) in | ||
return try container.make(HTMLRenderer.self) | ||
} | ||
} | ||
|
||
public func didBoot(_ container: Container) throws -> EventLoopFuture<Void> { | ||
return .done(on: container) | ||
} | ||
} |
Oops, something went wrong.