Skip to content

Instantly share code, notes, and snippets.

@vzsg
vzsg / 1_configure.swift
Created December 8, 2018 09:23
Vapor 3 Sessions with PostgreSQL example
import FluentPostgreSQL
import Vapor
public func configure(_ config: inout Config, _ env: inout Environment, _ services: inout Services) throws {
// (1) Standard PostgreSQL setup
try services.register(FluentPostgreSQLProvider())
let pgURL = Environment.get("DATABASE_URL") ?? "postgres://vapor:vapor@127.0.0.1:5432/vapor"
let pgConfig = PostgreSQLDatabaseConfig(url: pgURL)!