Fixed linux. Added /posts

This commit is contained in:
ilyakooo0 2018-11-30 02:21:58 +03:00
parent b113ab03f7
commit b6b2e10091
2 changed files with 5 additions and 0 deletions

View File

@ -33,6 +33,10 @@ public func routes(_ router: Router) throws {
}
return post
}
router.get("posts") { (req) -> [Post] in
return Array(Post.storage.values)
}
}
enum DatabaseError: Error, AbortError {

View File

@ -1,6 +1,7 @@
import App
#if os(Linux)
import SwiftGlibc
srandom(UInt32(time(nil)))
#endif