Files
cod-backend/Sources/App/configure.swift
Michael Simard 676a55d2df init
2020-05-25 23:32:28 -05:00

22 lines
693 B
Swift

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") ?? "fanosphere",
password: Environment.get("DATABASE_PASSWORD") ?? "pw4fanosphere",
database: Environment.get("DATABASE_NAME") ?? "codmw"
), as: .psql)
app.migrations.add(CreateMatch())
// register routes
try routes(app)
}