19 lines
555 B
Swift
19 lines
555 B
Swift
import Fluent
|
|
import FluentSQLiteDriver
|
|
import NIOSSL
|
|
import Vapor
|
|
|
|
// configures your application
|
|
public func configure(_ app: Application) async throws {
|
|
// uncomment to serve files from /Public folder
|
|
// app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory))
|
|
|
|
app.databases.use(DatabaseConfigurationFactory.sqlite(.file("db.sqlite")), as: .sqlite)
|
|
|
|
app.migrations.add(CreateUser())
|
|
app.http.server.configuration.address = .hostname("localhost", port: 43243)
|
|
|
|
// register routes
|
|
try routes(app)
|
|
}
|