on master help sign in
Fixed linux. Added `/posts`
commitb6b2e100919f09b622842bd622468d77b1ef7f1b authorilyakooo0 <ilyakooo0@gmail.com> dateFri 30 Nov 2018, 02:21 (8 years ago) parentb113ab0
2 files changed+5
unifiedsplit
Sources/App/routes.swift+4 Sources/Run/main.swift+1
Sources/App/routes.swift+4
@@ -33,6 +33,10 @@ public func routes(_ router: Router) throws {
3333 }
3434 return post
3535 }
36+
37+ router.get("posts") { (req) -> [Post] in
38+ return Array(Post.storage.values)
39+ }
3640}
3741
3842enum DatabaseError: Error, AbortError {
Sources/Run/main.swift+1
@@ -1,6 +1,7 @@
11import App
22
33#if os(Linux)
4+import SwiftGlibc
45srandom(UInt32(time(nil)))
56#endif
67