feat: Begins implementing dependencies as db controllers.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import Dependencies
|
||||
import Fluent
|
||||
import FluentSQLiteDriver
|
||||
import Leaf
|
||||
@@ -31,8 +32,12 @@ public func configure(_ app: Application) async throws {
|
||||
|
||||
app.views.use(.leaf)
|
||||
|
||||
// register routes
|
||||
try routes(app)
|
||||
try withDependencies {
|
||||
$0.employees = .live(database: app.db(.sqlite))
|
||||
} operation: {
|
||||
// register routes
|
||||
try routes(app)
|
||||
}
|
||||
|
||||
if app.environment != .production {
|
||||
try await app.autoMigrate()
|
||||
|
||||
Reference in New Issue
Block a user