on master help sign in
Fixed linux. Added `/posts`
b6b2e10ilyakooo0
Sources/App/routes.swift+4
unifiedsplit
@@ -33,6 +33,10 @@ public func routes(_ router: Router) throws {
33 }
33 }
34 return post
34 return post
35 }
35 }
36+
37+ router.get("posts") { (req) -> [Post] in
38+ return Array(Post.storage.values)
39+ }
36}
40}
37
41
38enum DatabaseError: Error, AbortError {
42enum DatabaseError: Error, AbortError {
Sources/Run/main.swift+1
@@ -1,6 +1,7 @@
1import App
1import App
2
2
3#if os(Linux)
3#if os(Linux)
4+import SwiftGlibc
4srandom(UInt32(time(nil)))
5srandom(UInt32(time(nil)))
5#endif
6#endif
6
7