first commit
This commit is contained in:
21
Sources/App/configure.swift
Normal file
21
Sources/App/configure.swift
Normal file
@@ -0,0 +1,21 @@
|
||||
import Fluent
|
||||
import FluentPostgresDriver
|
||||
import Vapor
|
||||
|
||||
// configures your application
|
||||
public func configure(_ app: Application) throws {
|
||||
// uncomment to serve files from /Public folder
|
||||
// app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory))
|
||||
|
||||
app.databases.use(.postgres(
|
||||
hostname: Environment.get("DATABASE_HOST") ?? "localhost",
|
||||
username: Environment.get("DATABASE_USERNAME") ?? "vapor_username",
|
||||
password: Environment.get("DATABASE_PASSWORD") ?? "vapor_password",
|
||||
database: Environment.get("DATABASE_NAME") ?? "vapor_database"
|
||||
), as: .psql)
|
||||
|
||||
app.migrations.add(CreateTodo())
|
||||
|
||||
// register routes
|
||||
try routes(app)
|
||||
}
|
||||
Reference in New Issue
Block a user