28 lines
622 B
Swift
Executable File
28 lines
622 B
Swift
Executable File
import Fluent
|
|
import Vapor
|
|
|
|
func routes(_ app: Application) throws {
|
|
app.get { req async throws in
|
|
req.redirect(to: "/index.html")
|
|
}
|
|
|
|
app.get("store") { req async throws in
|
|
req.redirect(to: "/index.html")
|
|
}
|
|
|
|
app.get("home") { req async throws in
|
|
req.redirect(to: "/index.html")
|
|
}
|
|
|
|
try app.register(collection: UserController())
|
|
try app.register(collection: PostsController())
|
|
try app.register(collection: MessagesController())
|
|
}
|
|
|
|
|
|
extension Date {
|
|
var millisecondsSince1970: Int64 {
|
|
Int64((self.timeIntervalSince1970 * 1000.0).rounded())
|
|
}
|
|
}
|